PHP GET not working
Posted: Tue Apr 14, 2009 1:13 pm
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
The weird thing about this code is that echoing variable $_GET["picnr"] results in 1. Which is what i want. But after inserting it into the DB i see 0 as the inserted value. I did the echoing part just to know if the value is there.
Helpz
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Code: Select all
<?php require_once "../dbcon.php";
echo $_GET["picnr"]; ?>
<?php if (isset($_POST['define_url'])) {
$result = mysql_query("INSERT INTO booklinks (username, picnr, url)
VALUES ('".$_COOKIE['username']."', '".$_GET["picnr"]."', '".$_POST['href']."')");
header("Location: ../engine_bookmarks/edit_books_index.php");
} ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="href" maxlength="1000">
<input type="submit" name="define_url" value="Määra">
</form>
Helpz
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: