Fanta Posted August 4, 2009 Share Posted August 4, 2009 if (isset($_post["proid"])) { $id = $_post["proid"]; } elseif (isset($_get["proid"])) { $id = $_get["proid"]; } else { echo "not set"; Ican see the data in the address bar but always comes out not set the code below is where the variable is sent <a href="edit.php?proid = <?php print $row["prod_id"]; ?>">EDIT | DELETE</a>; I use php/5.2.6 wamp server Link to comment https://forums.phpfreaks.com/topic/168752-cant-assign-data-_post_get/ Share on other sites More sharing options...
phpSensei Posted August 4, 2009 Share Posted August 4, 2009 its $_GET and $_POST not $_get and $_post no idea if that will make a difference and else { echo "not set"; close the bracket Link to comment https://forums.phpfreaks.com/topic/168752-cant-assign-data-_post_get/#findComment-890316 Share on other sites More sharing options...
phpSensei Posted August 4, 2009 Share Posted August 4, 2009 <a href="edit.php?proid = <?php print '1'; ?>">EDIT | DELETE</a>; to <a href="edit.php?proid=<?php print '1'; ?>">EDIT | DELETE</a>; FINAL PRODUCT <?phpif (isset($_POST["proid"])) { $id = $_POST["proid"]; print $id; } elseif (isset($_GET["proid"])) { $id = $_GET["proid"]; print $id; } else { echo "not set"; }?> Link to comment https://forums.phpfreaks.com/topic/168752-cant-assign-data-_post_get/#findComment-890317 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.