Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Very Simple Online Now Script, This is a very simple online now script.
ewcreators
post 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 smile.gif

Notice from rvalkass:

Added closing code tag.
Go to the top of the page
 
+Quote Post
delivi
post 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 smile.gif
Go to the top of the page
 
+Quote Post
bende4
post Oct 6 2007, 08:39 AM
Post #3


Newbie
*

Group: Members
Posts: 1
Joined: 5-October 07
Member No.: 51,144



Good script smile.gif
Go to the top of the page
 
+Quote Post
sonesay
post 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.
Go to the top of the page
 
+Quote Post
iGuest
post 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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Many Php Script Sites(16)
  2. I.p. Ping Online Or Offline(6)
  3. Script: Php Jukebox(4)
  4. Parse: Error Unexpected T_lnumber(4)
  5. Transfer Variables To Another Php Script(8)
  6. Watermark Your Image With Simple Php Script(35)
  7. Script That Tracks The User Status(4)
  8. Wappychat_oldskool(15)
  9. Free Auction Script(6)
  10. Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig(3)
  11. What Kind Of Script Do You Need ?(15)
  12. Creatting A Playlist Through Php(5)
  13. Html Code Tester. Online Script(15)
  14. Will This Code Work(5)
  15. Php Downloads Script(4)
  1. Script Help Required: Undefined Variable(3)
  2. Script Not Working(6)
  3. Library Script(6)
  4. How Would I Go About Making A Simple "counting" Script?(3)
  5. Forum Script(3)
  6. Php Rediret Script(12)
  7. Download Script For Mp3 Files(0)
  8. How Do I Connect To Live Database With Php Script?(6)
  9. Need Help Installing Dolphin Community Script!(5)
  10. Guessing Php Script(2)
  11. How To Make A View New Post Script?(5)
  12. Php Guest Online Script(3)
  13. How To Make Php Newsletter Script(3)


 



- Lo-Fi Version Time is now: 13th October 2008 - 04:41 PM