₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,327,139 members, 8,429,495 topics. Date: Friday, 19 June 2026 at 12:59 AM

Toggle theme

Danielatunrase's Posts

Nairaland ForumDanielatunrase's ProfileDanielatunrase's Posts

1 (of 1 pages)

ProgrammingRedirect User To Different Pages On First Time Login by danielatunrase(op): 2:16am On Aug 30, 2012
Hi,
I am using dreamweaver to develop a member area for a client's website. I need to check from the database if the person is logging on for the first time and redirect accordingly and then update the database so that it recognizes the person has logged on before. I am using php/mysql and have created am integer field called firsttime in my database and created my login page. I named the page the login goes to as redirect.php and have a code generated by dreamweaver to protect the page from unauthorized access. I am very new to this but understand the basics of what i want done. If someone could help me flesh it out I'd appreciate it.
1. Select the database
2. select firsttime from the database table where the username is still the session variable (Dreamweaver uses this $_SESSION['MM_Username'])
3. store the result of the query in a variable liek the result in the example below
4. check if the result is 1 (for an old user) and redirects to one.php or if the result is 0 (for a new user) and redirects to zero.php at the same time updating the firsttime field to 1 in this case.

Thats about it. I found this example in my search online but i don't know how to customize it to fit my needs. Will really appreciate the help
Regards.


<?php

$checkvisits = "SELECT firsttime FROM churchushers WHERE user=$user";
$result = mysql_query($checkvisits);
if($result <= "1"wink{
header("Location: first.php"wink;
} else {
?>

1 (of 1 pages)