Forum Moderators: coopster

Message Too Old, No Replies

php cookie based re-direct

redirect cookie based

         

shitlegs

4:35 pm on Oct 8, 2004 (gmt 0)

10+ Year Member



I am setting up my company's intranet site.
Is there any way I can direct a new user to a certain page on their first access to the intranet, like a registration form? Because i am using logon authentication throughout the site, I need the users to get a username and password before they get into the site so they can view all of the pages which they are supposed to be able to?
Sorry this is a bit messy; it's friday afternoon and I've been looking at code all day!
I am hoping that someone will interpret my message and get the general idea of what i am looking for.
Thanks, any help would be greatly appreciated.

theriddla1019

4:41 pm on Oct 8, 2004 (gmt 0)

10+ Year Member



what i do is if the user isnt found in the database of valid users it redirects them to an add user form
otherwise check to see if a cookie is set for the user if not redirect

if(isset($_COOKIE['cookiename'])){send them to login}else{send them to add user}

or something like that.

mincklerstraat

11:32 am on Oct 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sending them somewhere is with the location header:
header('Location: h**p://mysite.com/register.php');

You might want to put a login box there, or some kind of message, since users who have nuked their cookies might get confused : 'but I already registered'!

[edited by: ergophobe at 4:02 pm (utc) on Oct. 9, 2004]
[edit reason] unlinked url [/edit]

shitlegs

8:11 am on Oct 11, 2004 (gmt 0)

10+ Year Member



thanks very much.
I appreciate the help and will have a crack at it.
Dan