[REQ] Display a certain div if

Posted on Wednesday 21st May 2008 at 08:22 PM
Thomas
Thomas's Avatar
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
Adam981's Avatar
Wouldn't that be the same as the "newest user" that RMB has?
Posted on Saturday 24th May 2008 at 08:43 PM
new2old
new2old's Avatar
Run this is PHPMYADMIN

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


On login.php where you have the links

add

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


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

add

PHP Code
  1. if ($logged['first'] == "Yes") {
  2. $change = mysql_query( "UPDATE `members` SET `first` = 'No'" );
  3. }
  4. //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.
Login or register to respond to this forum topic.