|
|
|
|
![]() ![]() |
Aug 29 2007, 08:21 AM
Post
#1
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 59 Joined: 28-August 07 Member No.: 48,983 |
Hi all, Its Aldo.
anyways, I wont be using the method of pagination, i will just tell you how to make a basic online now script. When someone logs in, now take into consideration that the name of the username input is username (<input type.... name=username) First ,create a table in your database saying online now and add 2 fields to it. id and username CODE id type=integer(INT) , auto increment, length =255 and username = VARCHAR length=the limit a username should be in your site now from there we take off : CODE <?php //logged.php //authentication script //connection script //if connection success $insert=mysql_query("INSERT into onlinenow (name) VALUES ('$_GET[username]')")or die(mysql_error()); header('location:game.php'); //if authentication or connection fails, redirect them to an error page. ?> ----- <?php //game.php //suppose you have a box display game data //in that box, you want to show NUMBER of people online $onlinecount=mysql_query("SELECT * from onlinenow"); $ocount=mysql_num_rows($onlinecount); echo "Number of users online now: ".$ocount." "; ?> ------ <?php //onlinenow.php //i wont be dividing results into different pages echo "<table border=1><tr><th colspan=3>ONLINE NOW</th></tr>"; echo "<tr><td>ID</td><td>NAME</td><td>OPTIONS</td></tr>"; $oselect=mysql_query("SELECT * from onlinenow"); while($online=mysql_fetch_array($oselect)) { echo "<tr><td>".$online['id']."</td><td>".$online['username']."</td>"; echo "<td><a href='profile.php?a=$_SESSION[username]&s=$s&profile=$online[name]'>Visit Profile</a></td></tr>"; } echo "</table>"; ?> ----- if it doesn work or if you have suggestions, or opinions,,,please go ahead and edit |
|
|
|
Aug 30 2007, 02:08 PM
Post
#2
|
|
|
Trap Grand Marshal Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 1,314 Joined: 11-January 06 From: Chennai, India Member No.: 16,932 |
Nice Script, I'll try this out and add this to my new website which is under development
|
|
|
|
Oct 6 2007, 08:39 AM
Post
#3
|
|
|
Newbie ![]() Group: Members Posts: 1 Joined: 5-October 07 Member No.: 51,144 |
Good script
|
|
|
|
Oct 9 2007, 01:12 AM
Post
#4
|
|
|
|||[ n00b King ]||| ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 688 Joined: 20-June 07 From: Auckland Member No.: 45,102 |
could you show a full description of onlinenow table please? Im abit confused about hows its setup.
|
|
|
|
Sep 17 2008, 05:48 AM
Post
#5
|
|
|
Hail Caesar! ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 5,876 Joined: 21-September 07 Member No.: 50,369 |
script
Very Simple Online Now Script Can you send me full discription of multiple ques. -question by uttpal kachhawa |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th October 2008 - 04:41 PM |