(This msg. may arrive twice, with two different senders, I've had a little trouble with the news server)
Hi, thanks for your reply. > first $_SESSION works like this: > > session_start(); > $_session[user]=$_POST[user];//if using register_globals=off > $_SESSION[user]=$user;//if register_globals=on..unsafe though > > $_SESSION superglobal is an array (usually associative) meaning that the > element of the array (the part in the []) is either a variable name or some > custom name instead of the element number.... > > $_POST[user] and $user are 2 different variables if register_globals=off... Just a couple of questions. 1. I tried adding the lines as you wrote them, but then I got a "Notice: Use of undefined constant user - assumed 'user' in [FILENAME]", I assume I need to add quotation marks around "user" on both sides of the equal sign, that at least removes that notice. 2. I also get a "Notice: Undefined index: user in [FILENAME]", do I need to declare the $_SESSION variable before populating it? > to answer the second question about user/password names in scripts...if at > all possible avoid it at any cost to yourself...even in an include file... > use some other way to store/retrieve the user/password (mysql or something > like that). and for me if its a password i usually encrypt it before storing > it.. This was what I thought too The code we got from this person seems all messed up, I'm starting to wonder if it wouldn't be easier for me to build things from scratch rather than try to fix this *sigh*. > > hope that helps.. I'm pretty sure that it will, once I get my head around this 8-) /KLL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php