|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Sessions not working
Basic Info first. I am running Windows ME (don't know why just am) and I have downloaded PHPDEV423 and have also upgraded to PHP 4.3.0.
Everything on my computer seems to be working fine except sessions. I have tried a number of things and have tracked it down to sessions. I have downloaded a couple of scripts from the web I suspect are a little old. These scripts logo a user in but they do not seem to work because of the sessions. I have copied a test script out of a book I have and it does not work either, it looks like this: <? session_start(); session_register("your_name"); if(!empty($your_name)) { echo "I already know you name, $your_name"; } elseif(empty($your_name) && !isset($submit)) { echo "<form name=myform method=post action=$PHP_SELF> <input type=text name=first_name> first name<br> <input type=test name=last_name> last name<br> <input type=submit name=submit value=submit> </form>"; } elseif (isset($submit) && empty($your_name)) { $your_name = $first_name . " " . $last_name; echo "Thank you, $your_name"; } ?> On the first visit it should ask for your name and after hitting refresh if should say it already knows you name. It does creat a session but the only thing it puts in the file is this: !your_name| I have tried globals on and off. Has there been a change in the way sessions are handled that is making these scripts in need of a re-wright? I have put many houre into trying to solve this problem and help would be greatly apperaciated. |
|
#2
|
||||||
|
||||||
|
RE: Sessions not working
Quote:
you need to move session_register("your_name"); also look at http://www.php.net/docs.php for $_SESSION & $_POST reguardless of register_global setting php Code:
|
|
#3
|
|||
|
|||
|
RE: Sessions not working
Thank you for the reply I am starting to figure this out but the above code did not work for me either. I did however go through the sessions turtorial and that worked. What I would really like to know is why do none of the old scripts work there must be a way of configuring php to work with these old scripts. I got the script I posted out of MySQL/PHP Database Applications by Jay Breenspan and Brad Bulger and if it does not work then I need to know why so I will know if this is an old book that I need to trash or what, I just got it though so what is up?
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > Sessions not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|