Jump to content
xisto Community
Sign in to follow this  
apple

Directing To A User To Specific Page First Time Only

Recommended Posts

I make a signup page. I want that when someone signups and login for first time..then he is directed to the page X automatically. but after that it is redirected to Page Y always... Its pretty simple thing to do but im not understanding how i can make the script to identify that a person has logged in for first time ... anyhelp would be so welcome.Thanks.

Share this post


Link to post
Share on other sites

do you know how to work with cookies ?

since those are very usefull for first time only redirection

 

to know more about cookies ==> http://forums.xisto.com/no_longer_exists/

if the page loads in a language you cannot read, do this

 

go to http://php.net/

then fill in the search box => setcookie

normally you will get a list of search options but the setcookie is surely in it

click on it in the new page and you will be redirected to the documentation

 

from there on they explain good how to set and use cookies for webpages

 

good luck pall

Share this post


Link to post
Share on other sites

I'm not too familiar with databases but in my mind it would be a simple process. When the user signs up you create a new field in the column (record?) first_sign_in by the user's username. By default it would be FALSE.

 

Every time a person logs in one of the queries that would be executed is to check to see if first_sign_in is set to FALSE for that user. If it is set to FALSE, they are redirected to a page like first_sign_in.php; else direct them to index_members.php.

 

The page first_sign_in.php would alter the field first_sign_in to TRUE so that the user would not be directed there ever again.

 

As I said, I never did databases so I couldn't code it but this is the outline of what I would do.

 

PHP's MYSQL Documentation: http://uk.php.net/manual/en/ref.mysql.php

 

This would be better than cookies because some users wouldn't not allow their browsers to set them and most users delete their periodically. If your users keep getting redirected to the first-time page, it would serve as an annoyance. The field in the database will last as long as you want it to.

Share this post


Link to post
Share on other sites

Or an alternative to 'cookies' is using sessions.

They act like 'cookies', but are on the Server, not the Client's machine, so you don't have to depend on the client allowing cookies to be set.

 

You can find out more at the php.net site.

Search on "sessions" and you will have more information than you need.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.