PHP Not Reading Session Data (Solved) -


This code word is fine on my local host. However, Godaddy does not live with shared hosting. I have not researched problems well with any luck

It seems that the data is correctly stored in the / tmp folder (I see That new files are shown in the directory, because I click on the page from the page) However, there is no luck in reading the data on the following page.

I have given full access to the read / write / tmp folder. And I said GoDaddy and he said that everything is working properly on the server.

Here is the code. The user for the first time on this site, and definitely not my last :) Your help is highly appreciated.

Page 1 (test1.php)

  & lt; Php session_save_path ("/ tmp"); Session_start (); $ _SESSION ['name'] = "test"; The echo ("You should see" $ _ session ['name'] "on the next page."); Echo ("<<" & lt; a href = 'test2.php' & gt; Geo &   

page 2 (test2.php)

  & lt; php session_save_path ("/ Tmp "); session_start (); $ X = $ _SESSION ['name']; echo ($ x"> & gt; ";); echo (" & lt; a href = 'test1.php' Gt; Go Back & lt; / a & gt;); ? & Gt;  

session_save_path requires a full path. By specifying the folder as "TMP" with any leading slash, you are directing PHP to find a folder named TMP in the same folder for a file to run the folder. For example, if test1.php is being run from / var / www, then this session will try to write data to / var / www / tmp


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -