> index.php where they log in from
> <?
> session_start();  file://first line of file

Okay.

> ?>
> <form method="POST" action="main.php">
> <input type="hidden" value="lrlogin" name="form_action">
> Username&nbsp;&nbsp;<input type="text" name="username" class="color"><br
/>

<br/> ?  You been typing too much XML?... :-)

Shouldn't hurt.

> Password&nbsp;&nbsp;<input class="color" type="password"
name="password"><br
> />
> <input type="reset">&nbsp;&nbsp;&nbsp;<input type="submit" value="Login">
>
> code from main.php
> <?
> session_register();

Register what?  You're supposed to register a variable name...

> require ("db.php");
> if $form_action == "lrlogin"
> {
> get_user($username,$password);
> }
> ?>
>
> code from db.php
> <?
> session_start();

Doing this after you registered a variable is bogus -- The
session_register() automatically calls this if you haven't yet.

> SQL to select user info from db
> $access = $row[access_level]; file://etc getting vars from db
> session_register("username");
> session_register("password");
> session_register("access");
> session_register("active");
> header("Location:http://www.blah.com/index2.php?=".SID);

Doing session_start() (and, by extension, session_register()) in the same
file as a header("Location:") won't work on some browsers.  You'll either
get the cookie but no redirection or vice versa, depending on which browser
you are using.

And there should be a space after 'Location:'
And you probably need SID= for the SID to get passed on.
header("Location: http://www.blah.com/index2.php?SID=".SID);

> exit;
> ?>
>
> index2.php code
> <?
> session_start();
>
> print "Welcome $username";
> ?>
>
> it only prints Welcome ...no username :(

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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