mjurmann Posted July 13, 2007 Share Posted July 13, 2007 Hello. I have a hidden input field on a form that obtains its value by using the $_GET['prevID'] function and grabbing the value for 'id' from the previous URL pagename.php?id=123. I echoed out $_GET['id']; in the body and it echos out the correct number. This tells me that the get variable is intact as the data is transmitted between this page and the last. When I submit the form with the hidden input field, the $_POST['newID'] from the hidden input field does not echo out on the next page. Instead, the $_POST['newID'] 's value is NULL or "". Can someone help me as to why the value is getting lost like this? This is very strange because when I $_POST['Username'] and $_POST['Password'] on the next page, these two echo out fine. It's only $_POST['newID'] that seems to be empty, even though it clearly is being populated by $_GET['id]; from the previous URL. Thanks so much... <?php if ($_GET['prevID'] != NULL) { echo "AHHHH";?> <input type="hidden" name="newID" value="<?php $_GET['prevID'];?>" /> Link to comment https://forums.phpfreaks.com/topic/59829-solved-_post-question/ Share on other sites More sharing options...
metrostars Posted July 13, 2007 Share Posted July 13, 2007 <?php if ($_GET['prevID'] != NULL) { echo "AHHHH";?> <input type="hidden" name="newID" value="<?php echo $_GET['prevID'];?>" /> Link to comment https://forums.phpfreaks.com/topic/59829-solved-_post-question/#findComment-297477 Share on other sites More sharing options...
shamilton Posted July 13, 2007 Share Posted July 13, 2007 OR: <?php if ($_GET['prevID'] != NULL) { echo "AHHHH";?> <input type="hidden" name="newID" value="<?=$_GET['prevID']?>" /> Link to comment https://forums.phpfreaks.com/topic/59829-solved-_post-question/#findComment-297483 Share on other sites More sharing options...
mjurmann Posted July 13, 2007 Author Share Posted July 13, 2007 Metro - I have been trying to figure this out for hours upon hours. Thank you so much. You're my hero of the day! Link to comment https://forums.phpfreaks.com/topic/59829-solved-_post-question/#findComment-297484 Share on other sites More sharing options...
metrostars Posted July 13, 2007 Share Posted July 13, 2007 OR: <?php if ($_GET['prevID'] != NULL) { echo "AHHHH";?> <input type="hidden" name="newID" value="<?=$_GET['prevID']?>" /> I think you missed a ? from the start of the php code starter. Link to comment https://forums.phpfreaks.com/topic/59829-solved-_post-question/#findComment-297489 Share on other sites More sharing options...
shamilton Posted July 13, 2007 Share Posted July 13, 2007 Nope it's there Link to comment https://forums.phpfreaks.com/topic/59829-solved-_post-question/#findComment-297493 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.