Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing variable to the third form

Status
Not open for further replies.
Nov 16, 2002
24
US
To simplify my purpose, I have three forms here:
1. contains input field with accountName
<form method=&quot;POST&quot; action=&quot;choose.php&quot;>
2. choose.php, this only processes the data and redirects to other pages according to different account names, this is one of them: header(&quot;Location: homec.php&quot;);

3. homec.php

Here is the question: I couldn't pass acccountName to homec.php.

Any ideas?
 
did you try adding it to the url : header(&quot;Location: homec.php?<print $accountName?>&quot;);

Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
Sorry, it doesn't seem to work.

Actually, I would need the accountName throughout the pages, so it will be more than 3 pages using it. Shall I define it as global variable? I don't know how global variables work at all.


 
use a session maybe? Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
you can try:
session_start();
$_SESSION[&quot;AccountName&quot;] = &quot;value of inputbox&quot;;

on the pages that will use it:
session_start();
$accntName = $_SESSION[&quot;AccountName&quot;];
echo $accntName;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top