Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Directing To A User To Specific Page First Time Only
apple
post Feb 27 2007, 06:44 PM
Post #1


Newbie [Level 2]
**

Group: Members
Posts: 31
Joined: 9-August 06
Member No.: 28,049



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.
Go to the top of the page
 
+Quote Post
sniperkiller
post Feb 27 2007, 08:17 PM
Post #2


Member [Level 1]
****

Group: Members
Posts: 71
Joined: 31-January 07
Member No.: 38,083



do you know how to work with cookies ?
since those are very usefull for first time only redirection

to know more about cookies ==> http://be.php.net/manual/nl/function.setcookie.php
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
Go to the top of the page
 
+Quote Post
electriic ink
post Feb 27 2007, 08:41 PM
Post #3


Incest is a game the whole family can play.
Group Icon

Group: [MODERATOR]
Posts: 1,227
Joined: 11-February 05
From: Heaven
Member No.: 3,709



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.
Go to the top of the page
 
+Quote Post
jlhaslip
post Feb 27 2007, 10:13 PM
Post #4


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,077
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Php Login Script(18)
  2. User Login System With Setcookies(13)
  3. Cleaning User Input With Regex(1)
  4. How To Read Specific Row From Table(5)
  5. Password Strength / User Availablity Scripts ?(2)
  6. Script That Tracks The User Status(4)
  7. Replace A Character In A Specific Tag(7)
  8. Multiple Drop Down Lists ?(4)
  9. Compare 2 List Of User Ids From Different Tables(1)
  10. [mysql]get Id Of Loged In User?(7)
  11. Php Ftp Upload Form(1)
  12. Unexpected T_string In User.php [resolved](5)


 



- Lo-Fi Version Time is now: 7th October 2008 - 09:16 PM