Tutorial that Remembers Your Steps
Posted: Mon May 28, 2012 3:17 pm
Hi everyone, one of my friends would like to make an introductory tutorial on how to use their website. She wanted to make it kind of fun by having a 'character' be the tutorial guide. She has 5 characters she'd like the computer to randomly assign to new players. And since she doesn't really know PHP well, she's come to me. I don't know PHP well but I know it better than her, so here I am asking for a bit of help. Below is my logic.
1. Upon registering, a random number (1-5) is generated and inserted in to the user's table in the DB.
2. Upon logging in grab the $guide value
Now here's where I'm stumped on what to use. Is it possible to use php for this next step, or is it easier in some other form of code?
3. Have a file included called guide.php where there is a list of text to choose from (below). And then somehow display that message.
However this is a tutorial, remember, so there needs to be a link they click on called 'Next' which displays different information. Guide 1, step 1: "Hi! Ready to begin?" user hits the next button Guide 1, step 2: "Okay, so click on this button" etc
How would I be able to incorporate that, and have the computer remember which step they were on?
1. Upon registering, a random number (1-5) is generated and inserted in to the user's table in the DB.
Code: Select all
$guide = rand(1, 5);
mysql_query("INSERT INTO members (email, pass, pass_extra, user, pname, joindate, ip_address, activecode, guide)
VALUES ('$email', '$pass', '$salt', '$user', '$pname', NOW(), '$ip', '$key', '$guide')")
or die ('cannot create a new member ' . mysql_error());Code: Select all
$player = mysql_query("SELECT mid, user, pass, pass_extra, guide FROM members WHERE binary user = '$user'");
$player = mysql_fetch_assoc($player);3. Have a file included called guide.php where there is a list of text to choose from (below). And then somehow display that message.
Code: Select all
if($guide == 1){ echo 'Howdy! Here is step 1'; }
if($guide == 2){ echo 'Hello here is step 1'; }
if($guide == 3){ echo 'Hi here is step 1'; }
if($guide == 4){ echo 'Bonjour! Here is step 1'; }
if($guide == 5){ echo 'Hola here is step 1'; }How would I be able to incorporate that, and have the computer remember which step they were on?