Topic awaiting preservation: Problem with Post and form (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: Eagleshieldsbay, Sweden |
posted 03-16-2009 14:27
Hi! code: <body> <div id="center"> <div id="logo"><img style="border: 0px solid ; width: 150px; height: 100px;" alt="" src="../bilder/logga.jpg"></div> <div id="banner"><img style="border: 0px solid ; width: 650px; height: 100px;" alt="" src="../bilder/slogga.jpg"></div> <div id="menu"> <? include 'menu.php'; ?> </div> <div id="main"> <div class="content"> <? //$datum = date("j/n - y H:i"); //$datum = gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998)); //$timezone = +1; //(GMT -5:00) EST (U.S. & Canada) //$datum = gmdate("j/n - y H:i:s", time() + 3600*($timezone)); $submit = $_POST['submit']; $bild = $_POST['bild']; $info = $_POST['info']; $datum = $_POST['datum']; $remove = $_GET['remove']; $db = mysql_connect("lager.noh.se", "login","password"); mysql_select_db("lagernoh",$db); if (isset($submit)) { $sql = "INSERT INTO lager (info,bild,datum) VALUES ('$info','$bild','$datum')"; $back = mysql_query($sql); } if (isset($remove)) { $back = mysql_query("DELETE FROM lager WHERE id=$remove",$db); } $result = mysql_query("SELECT * FROM lager ORDER BY ID DESC",$db); if ($myrow = mysql_fetch_array($result)) { do{ echo "<p align=\"center\"> <img src=\"../bilder/lager".$myrow["bild"]."\"/ ><br /><br />".$myrow["info"]."</p><br /> <p align=\"right\">" .$myrow["datum"]." <a href=\"index.php?remove=".$myrow["id"]."\">ta bort</a></p>"; } while ($myrow = mysql_fetch_array($result)); } else { echo "inget i lager just nu!"; } ?> <form action="index.php" method="post" enctype="text/plain"> Bildnamn: <br /> <input type="text" name="bild" /> <br /> Information: <br /> <input type="text" size="80" maxlength="200" name="info" /> <br /> Datum: <br /> <input type="text" name="datum" /> <br /> <input type="submit" name="submit" value="Lägg i lager" /> <input type="reset" value="Rensa" /> </form> </div> </div> </div> </body>
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 03-16-2009 16:07
define 'does not get the post values'. |
Maniac (V) Inmate From: Eagleshieldsbay, Sweden |
posted 03-16-2009 17:37
quote:
|
Maniac (V) Inmate From: Eagleshieldsbay, Sweden |
posted 03-16-2009 18:10
I made a quick fix... |
Bipolar (III) Inmate From: Minnesota |
posted 03-16-2009 21:48
The problem is the enctype="text/plain" |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 03-17-2009 11:46
the point was to discern where your data flow breaks down |
Maniac (V) Inmate From: Eagleshieldsbay, Sweden |
posted 03-17-2009 15:39
Thank you Nathus and TP! |