Php problem
Hejza.. Jeg er stået af nu :-) jeg har nogle meget store kildekoder, men det er nu ikke det der skal kigges på. Det skal sættes sammen:## opret_felter.php:
<form method="post" action="<? print"$PHP_SELF"; ?>" target="_self">
<body style="font-family: Verdana; font-size: 10pt">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="35%" id="AutoNumber1" height="123">
<tr>
<td width="34%" style="border-style: none; border-width: medium" height="16" valign="top">
<font size="2">Brugernavn:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top: medium none #111111; border-bottom-style: none; border-bottom-width: medium" height="16" valign="top">
<input type="text" name="f_user" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Kodeord:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="1">
<input type="password" name="p1" maxlength="50" size="16" style="border-style: solid; border-width: 1; background-color: #FFFFFF"></font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Kodeord igen:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<input type="password" name="p2" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Navn:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<input type="text" name="navn" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Efternavn:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<input type="text" name="efternavn" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="15" valign="top">
<font size="2">Adresse:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="15" valign="top">
<input type="text" name="adresse" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Post nr. & by:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<input type="text" name="postnrby" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">E-mail:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<font size="1">
<input type="text" name="email" maxlength="50" size="16" style="border-style: solid; border-width: 1; background-color: #FFFFFF">
Skal være gyldig</font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Telefon / mobil:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<font size="1">
<input type="text" name="telefonmobil" maxlength="50" size="16" style="border-style: solid; border-width: 1; background-color: #FFFFFF"></font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Websted's navn:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<font size="1">
<input type="text" name="web_navn" maxlength="50" size="16" style="border-style: solid; border-width: 1; background-color: #FFFFFF">
</font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Websted's adresse:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<font size="1">
<input type="text" name="web_adr" maxlength="50" size="16" style="border-style: solid; border-width: 1; background-color: #FFFFFF">
Uden http://</font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Websted's beskrivelse:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<font size="1">
<textarea rows="3" name="web_beskrivelse" cols="15" style="border-style: solid; border-width: 1; background-color: #FFFFFF"></textarea></font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Websted's Kategori:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<font size="1">
<input type="text" name="web_kategori" maxlength="50" size="16" style="border-style: solid; border-width: 1; background-color: #FFFFFF"></font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Målgruppe:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<select size="1" name="maalgruppe" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF">
<option>Under 18 år</option>
<option>18-25 år</option>
<option>26-30 år</option>
<option>31-35 år</option>
<option>36-40 år</option>
<option>41-50 år</option>
<option>51-60 år</option>
<option>Over 60 år</option>
</select></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17" valign="top">
<font size="2">Viste sider pr. måned:</font></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17" valign="top">
<input type="text" name="viste_pr_maaned" maxlength="50" size="16" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF"><font size="2">
</font></td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="17">
<input type="hidden" name="action" value="<? print"$PHP_SELF"; ?>">
<input type="submit" value="Opret" style="font-size: 10pt; border-style: solid; border-width: 1; background-color: #FFFFFF" name="opret"></td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="17">
</td>
</tr>
<tr>
<td width="34%" style="border-left: medium none #111111; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="10">
</td>
<td width="87%" style="border-left-style: none; border-left-width: medium; border-right: medium none #111111; border-top-style: none; border-top-width: medium; border-bottom: medium none #111111" height="10">
<font size="2">Alle felter skal udfyldes!</font></td>
</tr>
</table>
##
## opret_finish.php
<?
include("cont.php");
$brugernavn = $HTTP_POST_VARS[brugernavn];
$kodeord = $HTTP_POST_VARS[kodeord];
$email = $HTTP_POST_VARS[email];
$telefonmobil = $HTTP_POST_VARS[telefonmobil];
$navn = $HTTP_POST_VARS[navn];
$efternavn = $HTTP_POST_VARS[efternavn];
$adresse = $HTTP_POST_VARS[adresse];
$postnrby = $HTTP_POST_VARS[postnrby];
$web_navn = $HTTP_POST_VARS[web_navn];
$web_beskrivelse = $HTTP_POST_VARS[web_beskrivelse];
$web_adr = $HTTP_POST_VARS[web_adr];
$maalgruppe = $HTTP_POST_VARS[maalgruppe];
$viste_pr_maaned = $HTTP_POST_VARS[viste_pr_maaned];
if ($brugernavn == ""){
print " Du mangler at udfylde dit brugernavn!<br>";
}
if ($kodeord == ""){
print " Du mangler at udfylde dit kodeord!<br>";
}
if ($email == ""){
print " Du mangler at udfylde din e-mail adresse!<br>";
}
if ($telefonmobil == ""){
print " Du mangler at udfylde dit telefon eller mobil nummer!<br>";
}
if ($navn == ""){
print " Du mangler at udfylde dit navn!<br>";
}
if ($efternavn == ""){
print " Du mangler at udfylde dit efternavn!<br>";
}
if ($adresse == ""){
print " Du mangler at udfylde din adresse!<br>";
}
if ($postnrby == ""){
print " Du mangler at udfylde dit post nr. og by!<br>";
}
if ($web_navn == ""){
print " Du mangler at udfylde dit websites navn!<br>";
}
if ($web_beskrivelse == ""){
print " Du mangler at udfylde din web beskrivelse!<br>";
}
if ($web_adr == ""){
print " Du mangler at udfylde din web adresse!<br>";
}
if ($maalgruppe == ""){
print " Du mangler at udfylde din målgruppet!<br>";
}
if ($viste_pr_maaned == ""){
print " Du mangler at udfylde hvor mange visninger du har pr. måned!<br>";
}
if ($brugernavn != "" && $kodeord != "" && $email != "" && $telefonmobil != "" && $navn != "" && $efternavn != "" && $adresse != "" && $postnrby != "" && $web_navn != "" && $web_beskrivelse != "" && $web_adr != "" && $maalgruppe != "" && $viste_pr_maaned != "") {
mysql_query("INSERT INTO D_brugere (brugernavn, kodeord, email, telefonmobil, navn, efternavn, adresse, postnrby, web_navn, web_beskrivelse, web_adr, maalgruppe, viste_pr_maaned)
VALUES('$brugernavn', '$kodeord', '$email', '$telefonmobil', '$navn', '$efternavn', '$adresse', '$postnrby', '$web_navn', '$web_beskrivelse', '$web_adr', '$maalgruppe', '$viste_pr_maaned')") or die (mysql_error());
?>
##
Det kan godt være der skal rettes lidt i koderne..!
Der er kun 10 points på nu. Men der vil komme min. 50 points!!
