tranquillo
Technical User
here we go again..
----------------------------
----------------------------
<?php
$db = mysql_connect("localhost", "root"
mysql_select_db("seko",$db);
$kid = $_POST["kid"];
$namn = $_POST["namn"];
$gadr = $_POST["gadr"];
$postnr = $_POST["postnr"];
$ort = $_POST["ort"];
$sek = $_POST["sek"];
if ($Submit) {
$query = "INSERT INTO klubb(klubbID,namn,gatuadress,postnummer,ort,sektion)
VALUES('$kid','$namn','$gadr','$postnr','$ort','$sek')";
$result = mysql_query($query);
$result2 = mysql_query("SELECT * FROM klubb order by klubbID desc",$db);
}
if ($myrow = mysql_fetch_array($result2))
{
printf("<b>Klubb ID:</b> %s<br>\n", mysql_result($result2,0,"klubbID");
printf("<b>Klubbnamn:</b> %s<br>\n", mysql_result($result2,0,"namn");
printf("<b>Adress:</b> %s<br>\n", mysql_result($result2,0,"gatuadress");
printf("<b>Postnummer:</b> %s<br>\n", mysql_result($result2,0,"postnummer");
printf("<b>Ort:</b> %s<br>\n", mysql_result($result2,0,"ort");
printf("<b>Sektion:</b> %s<br>\n", mysql_result($result2,0,"sektion");
} else {
echo "Sorry, no records were found!";
}
?>
----------------------------
----------------------------
<form name="links" method="post" action="<?php echo $PHP_SELF?>">
<p><br>
<table border="0" class="textsmallbold">
<tr>
<td> Klubb ID : </td>
<td><input type="text" name="kid"></td>
</tr>
<tr>
<td>Klubbens namn : </td>
<td><input type="text" name="namn"></td>
</tr>
<tr>
<td>Gatuadress : </td>
<td><input type="text" name="gadr"></td>
</tr>
<tr>
<td>Postnummer : </td>
<td>Ort :</td>
</tr>
<tr>
<td><input type="text" name="postnr">
<td><input type="text" name="ort"></td></td>
</tr>
<tr>
<td>Sektion : </td>
<td> <select name="sek">
<option value="Väg&Ban sydost">Väg&Ban sydost</option>
<option value="Väg&Ban nordost">Väg&Ban nordost</option>
</select></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
<tr>
<td colspan="2" align="left"> </td>
</tr>
</table></p>
</form>
----------------------------
----------------------------
what am I doing wrong? this code used to work... but I moved it around and at the beginning it was split up on two pages... and now it don't work... is it the --- action="<?php echo $PHP_SELF?>"> --- thing that screws thing up? coz that's the only thing I can think of... (it's 5am, so I might have missed a couple of things though) and I don't know how to do the php_self thing...
thanks
----------------------------
----------------------------
<?php
$db = mysql_connect("localhost", "root"
mysql_select_db("seko",$db);
$kid = $_POST["kid"];
$namn = $_POST["namn"];
$gadr = $_POST["gadr"];
$postnr = $_POST["postnr"];
$ort = $_POST["ort"];
$sek = $_POST["sek"];
if ($Submit) {
$query = "INSERT INTO klubb(klubbID,namn,gatuadress,postnummer,ort,sektion)
VALUES('$kid','$namn','$gadr','$postnr','$ort','$sek')";
$result = mysql_query($query);
$result2 = mysql_query("SELECT * FROM klubb order by klubbID desc",$db);
}
if ($myrow = mysql_fetch_array($result2))
{
printf("<b>Klubb ID:</b> %s<br>\n", mysql_result($result2,0,"klubbID");
printf("<b>Klubbnamn:</b> %s<br>\n", mysql_result($result2,0,"namn");
printf("<b>Adress:</b> %s<br>\n", mysql_result($result2,0,"gatuadress");
printf("<b>Postnummer:</b> %s<br>\n", mysql_result($result2,0,"postnummer");
printf("<b>Ort:</b> %s<br>\n", mysql_result($result2,0,"ort");
printf("<b>Sektion:</b> %s<br>\n", mysql_result($result2,0,"sektion");
} else {
echo "Sorry, no records were found!";
}
?>
----------------------------
----------------------------
<form name="links" method="post" action="<?php echo $PHP_SELF?>">
<p><br>
<table border="0" class="textsmallbold">
<tr>
<td> Klubb ID : </td>
<td><input type="text" name="kid"></td>
</tr>
<tr>
<td>Klubbens namn : </td>
<td><input type="text" name="namn"></td>
</tr>
<tr>
<td>Gatuadress : </td>
<td><input type="text" name="gadr"></td>
</tr>
<tr>
<td>Postnummer : </td>
<td>Ort :</td>
</tr>
<tr>
<td><input type="text" name="postnr">
<td><input type="text" name="ort"></td></td>
</tr>
<tr>
<td>Sektion : </td>
<td> <select name="sek">
<option value="Väg&Ban sydost">Väg&Ban sydost</option>
<option value="Väg&Ban nordost">Väg&Ban nordost</option>
</select></td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
<tr>
<td colspan="2" align="left"> </td>
</tr>
</table></p>
</form>
----------------------------
----------------------------
what am I doing wrong? this code used to work... but I moved it around and at the beginning it was split up on two pages... and now it don't work... is it the --- action="<?php echo $PHP_SELF?>"> --- thing that screws thing up? coz that's the only thing I can think of... (it's 5am, so I might have missed a couple of things though) and I don't know how to do the php_self thing...
thanks