![]() |
|
#1
|
|||
|
|||
need help understand sessionsI'm teaching myself php, and I'm stuck. I have a two part form, each part opn a seperate page. I want to send info from page one to page two. Thought ok, I use session variables. The problem is that they don't get sent to the second page. All works fine on my local testing server, but when I go live session varables don't show. HAs this something to do with header? Is there another way to get to the second page?
Any help would be welcomed> Here's part of the code After user submits first form I load if to session variables in step one PHP Code:
Step Two PHP Code:
I dont' see anything |
|
#2
|
||||
|
||||
Re: need help understand sessionsWhy can't you just process the input data from the first form, and add it as HIDDEN input data within the second form?
|
|
#3
|
|||
|
|||
Re: need help understand sessionsNo.
I need to know what's in $_SESSION['number_divers'] in order to format the second form i.e. I only want detailed driver info depending on the number of drivers. So if there's two I have driver 1 input detail section and driver 2 input detail sections. If there would be three or four I'd add more. This all works fine when I'm testing on my localhost, but when I upload and try "live" the session variables don't go over. The only difference in the code is this When local I use this: header('Location: http://localhost/my_auto_quotes_2.php'); When I'm live I use this: header('Location: http://example.com/my_auto_quotes_2.php'); |
|
#4
|
|||
|
|||
Re: need help understand sessionsProblem solved. I stumbled accross this while pulling my hair out. Now I'm kicking myself.
For the header I had this... header('Location: http://example.com/btracy_auto_quotes_2.php'); What I should have had was this... header('Location: http://www.example.com/btracy_auto_quotes_2.php'); Three little w's made the difference, session variables now work. |
Recent GIDBlog
Welcome to Baghdad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The