Jump to content

[SOLVED] $_POST question


mjurmann

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.