0

I am using WAMP server to code a form.
The form contains 6 different pages.
On the WAMP server when I go through the form it works perfectly, all session variables are brought from one page to the next, and so on.
I call session_start() before each and every page and define my $_SESSION[''] variables to my $_POST[''] variables.
From page 1 to page 2, the information is transfered and works fine, however from page 2 to page 3, all information is lost.
This to me looks like the session working incorrectly, however I am sure I did something wrong.
Any ideas?

3
Contributors
5
Replies
23
Views
4 Years
Discussion Span
Last Post by ytrobe
0

What are you looking for?

<?php
session_start();
?>

is called at the beginning of every page, i use:

$_SESSION['test'] = $_POST['test'];

to store session variables.

All data from page 1 is stored in session variables on page 2...
All data from page 2 is stored in session variables on page 3... etc

Like I said if I go through the form from localhost on my WampServer it works just the way I have coded it and the way I WANT it to work, however when I upload it to a hosted server the session variables dont make it past the second page!
^^How do I know this?^^

I have a call on page 3 that displays several fields from both pages 1 and 2. When I get to page 3 on the hosted server, nothing is shown in the php calls e.g.(<?php echo $_SESSION[''] ?>)

0

If IIM's solution doesn't fix your problem can you stick pages 1, 2 and 3 into a zip file and upload?

1

Sorry it has taken me so long to respond as I have been trying many things to get this to work.

The problem was solved, unfortunately not from IIM's post, (but thank you for your help non-the-less)

The problem ended up being in the php.ini of the hosted server! My WAMP server sets up the session.save_path to a default directory already created within the virtual server, whereas the hosted server's session.save_path is not by default created. After tweaking the save path on the hosted server and creating the folder for sessions to be stored the form is now working perfectly.

Thank you all for your interest and help!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.