Hi,
I am new to Php and having problems with redirecting of page particularly sending variables across pages.
I have this page1 which contains an if else statement.
If
{
User types in two text fields code should be executed and the page should be resubmitted to the same page with database results. For this reason I am using the form attribute of the page and directing the action variable in the form attribute to page1 ( this page itself) on submit.
Else
{
Now if user types in only one text field, it should go to another page wherein the another page should be able to receive the value entered by the user in the page1. I have got suggestions saying I can do this by using page header redirect to another page and concating the value of the textbox to the header variable. I am using this in page 1
<code> header("Location: Decryption.php?usersubmit=".urlencode($POST($usersubmit))); </code> // Usersubmit is the value entered in the textbox field by the user.
and in page 2
<code> $userId = $GET['usersubmit']; </code>
But of no use.
I also tried creating a session variable here and using the session variable in the page2. But that does not work either.
}
Someone please help me. Let me know if you have any questions?
Thanks,