Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 434
0 Users 6 Guests Online
Forum Index » PHP + MySQL » [REQ] Display a certain div if
Posted on Wednesday 21st May 2008 at 08:22 PM
Thomas
templates/default/images/noavatar.png's Avatar
Newbie
Just wondering if there is anyway to make a div appear if a user has logged in for the very first time? ;]
Posted on Wednesday 21st May 2008 at 09:48 PM
Adam981
templates/default/images/noavatar.png's Avatar
Junior Member
Wouldn't that be the same as the "newest user" that RMB has?
Posted on Saturday 24th May 2008 at 08:43 PM
new2old
templates/default/images/noavatar.png's Avatar
Junior Member
Run this is PHPMYADMIN

PHP Code
1
2
ALTER TABLE `members` ADD `first` VARCHAR( 3 ) default 'Yes'


On login.php where you have the links

add

PHP Code
1
2
3
4
5
6
7
if ($logged['first'] == "Yes") {
echo ( " //DIV HTML HERE " );
echo ( " //Existing Links here " );
} elseif ($logged['first'] == "No") {
echo ( "//Links here" );
}


Open logout.php right under include "config.php";

add

PHP Code
1
2
3
4
5
if ($logged['first'] == "Yes") {
$change = mysql_query( "UPDATE `members` SET `first` = 'No'" );
}
//Rest of the logout code here


That's it

any errors let me no, would be a good idea to put in the div for first time users that they will need to logout for it to disappear.