The problem lies with the fact that you have a variable 'name' that gets
posted in the form as well as a session variable 'name' that is passed to
the script when it is executed again. As far as I remember the session
variable supercedes the posted variable, so the session variable would
overwrite the value of the posted variable every time. You need to register
the session variable with another name and then toggle between the two
variables in you script.

Also, a session variable need only be registered once:
if (!session_is_registered("name")) {
        session_register("name");
}

Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions
Tel. +27(0)11 266 6946
Fax. +27(0)11 266 5080
Cell: +27(0)82 895 1598
E-mail: [EMAIL PROTECTED]


-----Original Message-----
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 09:08
To: [EMAIL PROTECTED]
Subject: [PHP] Session


Hi,

I have read: http://www.php.net/manual/en/function.session-register.php

Could I ask you a question about how to set a session $vars in a <FORM>?
It seems to be quite a mystery/controversy!!

This is my problem:
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php

Type something.
Press submit.
Change your text and re-submit.

$name doesn't re-save itself. This is my code:
http://www.collegesherbrooke.qc.ca/languesmodernes/postcard/test_session.php
s

Would you have any suggestions?
It can't be that complicated can it?

J.T-Johnston



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to