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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.