Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Any Script That Will Show If User Is Online?


does anyone can give example of a script in php that will show if the user is online?




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Show Users Online
I have a script that multiple users can logged in. is there a way I can show the current users that are logged in?

View Replies !   View Related
How Do I Show How Many Users Are Online?
How do I show how many users are online, is this using sessions and is it complex to do? Doesn't need to be realtime, just something basic.

View Replies !   View Related
Best Way To Show Users Online?
i was wondering the best way to show users online, my sessions setup is like: Code:

View Replies !   View Related
Show List Of Users Online
How can i list the users logged into the system?

Maybe save the list of session id in application attribute?

View Replies !   View Related
User Online
I need to be able to tell and post it out to a web page when/who is on my website. There is a login screen, a members mysql database, and the rest of the site is php.

View Replies !   View Related
How Many User's Online
im new here and i just want to know where can i get a hit counter that say's the hit's and how many user's online that's all i want or could some one give me some tip's on making one or give me a url of a place to learn php.

View Replies !   View Related
Online User
The php page just has a function that access the variable defined by this script(stored in a text file). I would like to modify this script to not ++ the variable, but I am unsure of the items I should change w/o ruining the script.

View Replies !   View Related
User Online Script
I will like to know how can I check an IP to see if the ip is alive or DEAD. I was going to do this with the function fsockopen(); but it require a port.

View Replies !   View Related
User Online Time
I was searching trough internet and didn't find anything useful ..

I want to do user online time counter... Like this one on phpFreaks.

Total time logged in: 180 hours and 15 minutes.

View Replies !   View Related
Online User Management
Vielleicht kan mir von euch einer eine kleine hilfe zu meinem problem liefern : Ich brauche eine Art Online User Management, das heißt wenn sich ein user auf meiner page anmeldet muss ich immer genau wissen wo er sich gerade befindet und natürlich wenn er wieder von meiner seite verschwindet. wie kann ich das am besten machen ? cookies und merken der session in meiner datenbank?

View Replies !   View Related
User Online Issue
$timeMax = time() - (60* SESSION_LENGTH);

$result = mysql_query("select count(*) from usersOnline where unix_timestamp(dateAdded) >= '$timeMax' and permission ='0'");
$usersOnline = mysql_result($result, 0, 0);

$resulta = mysql_query("select count(*) from usersOnline where unix_timestamp(dateAdded) >= '$timeMax' and permission = '1'");
$usersOnline2 = mysql_result($resulta, 0, 0);

ok there has to be a way to set a limit .. the numbers just go through the roof. go beyond as many users there can possibly be online is there a way to put a limit in there somehow. the rest of my code is like this. where i get how many total users there are.

$result3 = mysql_query("SELECT COUNT(*) AS count FROM users WHERE permission = '0'");
$row = mysql_fetch_array($result3);

$result4 = mysql_query("SELECT COUNT(*) AS count FROM users WHERE permission = '1'");
$row2 = mysql_fetch_array($result4);

echo "ATM:" . ($usersOnline2 != 1 ? "" : "") . " $usersOnline2 Admin" . ($usersOnline2 != 1 ? "s" : "") ." / $row2[count]" . ", " . ($usersOnline != 1 ? "" : "") . " $usersOnline User" . ($usersOnline != 1 ? "s" : "") ." / $row[count]" . ". ";

the bottom code gives away the total admins and regulars on my system.  now i am trying to limit the above code to those numbers so only up to 2 admins and users remain.

View Replies !   View Related
Check Online User
How do I check whether a user is online or not? is it with session?

View Replies !   View Related
Check If User Is Online
Could it be made a script that check if a user connection is breaked (for example internet connection is stopped or user is closed the browser). And not only to be displayed error message to the user but this event to be registered by my PHP script.
For now the only idia that i have is a JavaScript event onClose() of the browser but this is not the solution that I want.

View Replies !   View Related
Time Online User System
I'm building something special but dont really know whats the best way to start this
i want to messure time online from users that signup for it So i can make a toplist of the best visitors that where online and active But how do i messure time and how do i abort it when they are not active for a <? while ?>?

View Replies !   View Related
User Status Online/Offline?
I want to know how to check that user is online or offline by Php.If
he visit pages then he is online, if he not accessed page he is
offline. How to handle this is in PHP...I set session of each user......

View Replies !   View Related
How To Detect User Online/offline?
how to detect user online/offline?
by storing user login status inside mysql?
wat if user go offline? how php know when user get offline or close the browser?

View Replies !   View Related
How To Find A User Is Online In Local Intranet
how to find a user is in online or not in the local intranet with php. we have any default functions.

View Replies !   View Related
PHP / MySQL Online Status For User Authentication System
I'm working on a user authentication system. My problem is with an "online status" element. So far, I have that when the user logs in, a field in my members MySQL table, called loggedinstatus is set to 1. This means that that certain user is currently logged in.

The problem is, is that the only way that loggedinstatus is set to 0 (the user is not logged in) is when the user clicks the logout link. If the user just goes to another website or closes his or her browser, the loggedinstatus is left at 1. How would I get around this problem?

View Replies !   View Related
Show Logged In User
I need a code that prints "Hello, $username" code can anybody help me by wrighting this out for me? I have the variable $username for the username.

View Replies !   View Related
Show Code To A User
I want to show a php code to a user. how would I do this? I know I can't use the code tags, is there a php tag(for a site, not forum)?

View Replies !   View Related
Show Current User
I'm having trouble wit a code, i'm quite sure is wrong, what I want is a code that will show the current user, eg Hello Chris. ANyway whats wrong with mine, or whats right,

<?php mysql_query("SELECT username FROM users"); echo ($_POST['username']); ?>

View Replies !   View Related
Show The Form Again With The Responses The User Entered
On the action page, I check certain fields to make sure they are only digits.  If not, it returns false.  What I'd like to do is show the form again with the responses the user entered, but leaving the incorrect fields blank.  Is that possible?

View Replies !   View Related
Unable To Show Current Logged In User
i am not sure what is going on but when i login and that works fine but if i want to show the the user who they are logged in as in the members section for example you are loged in as who ever, it does not show Code:

View Replies !   View Related
User Inputted Text Wont Show In Email
I copied the contact_us page,renamed it, and added some fields which I want added to an email. The input fields show on the site but the user inputted text doesn't get added to the email, just the comment text gets added. Its basically going to be an application for employment when done but I'm just trying to get it to work with the four added questions. Code:

View Replies !   View Related
Show The Image Once It Has Been Uploaded Before The User Submits/saves The Product.
I have a PHP based form which enables a user to upload an image of a product. The user would first define the product by inputting the details of the product and then select the image to upload. I would also like to show the image once it has been uploaded before the user submits/saves the product.

View Replies !   View Related
Checkboxes - Show A Tick In The Boxes To Show That They Have Already Been Added.
I have been trying to learn checkboxes and arrays, and I've finally figured out how to add the checkboxes to the database.

I currently have two forms  addlinks.php and modifylinks.php and I have a dolinks.php that submits my data to the database.

What I would like to do now is on my modifylinks page show a tick in the boxes to show that they have already been added.

At the moment if I dont tick any boxes on modifylinks.php it deletes my previous data, and I have to retick them everytime I do an update. Code:

View Replies !   View Related
Code To Show Slide Show In PHP
Can anyone guide me as to how can i display a slideshow of all the images present in an album and if possible the code.

View Replies !   View Related
Show Table Only If There Is Data To Show?
I have a table that shows specific data (via a while loop)

however, when you first log in as a new user, you see the table column headers but there is obviously no data, and it looks a bit unsightly.

How could i take this code:

View Replies !   View Related
Show First 10 Records, Then Show The Rest
Is it possible to show a fixed number of rows in a repeat region, then show all the rest?

What I mean is - I've got between 40 and 50 records in a database and it's easy to show them 10 at a time. But what I'd like to do is show the first 10, then show all the rest in one go. Code:

View Replies !   View Related
Perform Redirection Of The User's Browser If The User Isn't A Valid User.
I'm running PHP on Windows, but that's just the local test... in production
it will be on Apache.

I am not using PHP as a CGI. I want to perform redirection of the user's
browser if the user isn't a valid user. I don't want to use the refresh
meta tag or javascript to do this. I want to do this with some sort of
server command.

Does anyone know how to make this work? Here's my code...
<?php
session_start();
$goal = "";
if (array_key_exists('goal', $_GET)) { $goal = $_GET['goal']; }

if (isset($HTTP_POST_VARS['userid']) && isset($HTTP_POST_VARS['password']))
{
$userid = $HTTP_POST_VARS['userid'];
$password = $HTTP_POST_VARS['password'];
$db_conn = mysql_connect('localhost', 'webauth', 'webauth');
mysql_select_db('auth', $db_conn);
$query = "select * from auth where name='$userid' and
pass=password('$password')";
$result = mysql_query($query, $db_conn);
if (mysql_num_rows($result) > 0) {
$HTTP_SESSION_VARS['valid_user'] = $userid;
}
}

View Replies !   View Related
MySQL 'SHOW TABLES' Doesn't Show Temporary Tables?
I have a function call which creates a temporary table in MySQL, and then a second function call which operates on that temporary table.

I was hoping to do something like this in the second function call to ensure that the table was in fact actually created:

if (mysql_num_rows(mysql_query("SHOW TABLES LIKE 'my temp table name'")))
// do something
else
//error

However, apparently the MySQL SHOW TABLES statement doesn't show temporary tables. Is there another query that I can use to show temporary MySQL tables so I can do this check?

View Replies !   View Related
User Is Verified By A MySQL Database, And Then A Session: 'user' Is Registered.
I have a problem with sessions. In my code admin.php the user is verified by a MySQL database, and then a session: 'user' is registered.

Well when the user presses a link to a another page called news.php it will be checked if the session is the same as in the same script, or if it's even registered (to prevent people trying to break in). But everytime i redirect to news.php I get a file included ip.php wich tells me Im about to break in. Code:

View Replies !   View Related
Update Based On The Type (admin/user) For A Single User
This page shows all the users in the database and the type they are (admin/user). Basically what am trying to do is update based on the type (admin/user) for a single user... and I know I need to have my UPDATE query have a WHERE statement, Code:

View Replies !   View Related
If The User Logs In, And Closes The Browser Window, How Do I Know That The User Has Logged Out.
I am creating a site that has a session based log in. Pretty simple stuff, but the bosses have asked if we can make it so that only 1 person can log into an account at once (ie if someone logs in with a specific acocunt, lock the account and dont let any one else log in)

I'v been fiddleing around with session, and various session variables etc. and the only part that I cant figure, is if the user logs in, and closes the browser window, how do I know that the user has logged out.

View Replies !   View Related
PHPmyadmin Access Denied For User 'user'@'localhost'
WinMe machine as server, with Apache 2 installed and working PHP4 installed and working ( had PHP 5.05 installed and working, but i couldnt get the mysql extensions to load - phpinfo() didnt list mysql :(, so i installed PHP4, which now lists mysql when i run phpinfo). MYSQL 4.1 installed and working. I dont know the console commands too well, but i know its working ok, cos I have used a few simple DOS prompt commands to check its alive and I can connect to the database using MyODBC frontend/driver 3.51 and also using Navicat 2004.

When i try to connect to the database via PHPmyadmin from another network PC I have an error:

#1045 - Access denied for user 'user'@'localhost' (using password: YES)

I have played around alot with different settings in the config.inc.php file.... nothing seems to work.

This almost appears to be a simple login problem ( probably is too), but I can access the database locally from the Winme machine with the username and password that wont work over the network!

I have tried not using 'localhost' as the host name but the IP address of the Winme PC but I get this error:

#1130 - Host 'MYSERVERNAME' is not allowed to connect to this MySQL server

View Replies !   View Related
Notice: Use Of Undefined Constant User - Assumed 'user'
I have a script for a shopsystem on a Linux. There it works fine.
But when I try to run it on my Windows machine, PHP says things like

Notice: Use of undefined constant dbname - assumed 'dbname' in
c:apachehtdocsaposhop estshopclassesxxx.clas s.php on line 77

On Windows I run PHP 4.3.2
On Linux runs PHP 4.3.1

View Replies !   View Related
Make A Form Where The User Can Log In And It Would Check If They Were A Valid User
i have created a user registration script where when u fill out the user name and password, it fwrites it to a txt file on the server. Now, my problem is. I would like to make a form where the user can log in and it would check if they were a valid user or if their username and password matches, how would i go about doing this.

View Replies !   View Related
Makes A User To Log Out Automatically If The User Is Inactive For 30 Minutes
im making an web-based game and im trying to make a code that makes a user to log out automatically if the user is inactive for 30 minutes, but im totally stuck on doing it.

And im also trying to make a countdown script. Example: The user is buying an item, the delivery of the item takes 2 minutes. 2 minutes later the user have the item. How do i make that in the MySQL table, and continue ticking even if the user is not logged in?

View Replies !   View Related
Access Denied For User: 'user@localhost' (Using Password: YES)
I have been trying to load a csv file into a pre-existing table but I keep getting this error: Code:

View Replies !   View Related
Redirect The Logged In User To Home.php Without Any Clicking From The User
I have this login script that calls on itself to authenticate the username and the password. It redisplays the login page if there is an error. My question is how do I redirect it to a different page, when the user is authenticated (i.e. the address in the address box changes to a new name, for example, if the login page is called login.php,.

then I want to redirect the logged in user to home.php without any clicking from the user). I realize that there is a header function available, but I've heard that any
information related to the current session is lost upon using this function. Is there any better way?

View Replies !   View Related
Authenticating User Common User Names
I want to create a password protected page with PHP and Mysql. I have 2 groups User and Admin. The respective groups have a common user/password. The user/password are stored in a database. I want to authenticate the user through a login form and not through a pop-up ($PHP_AUTH_USER) way.

What I want is, if a user logs in and he moves from one page to another, he should not be asked for validity again. Is this possible only with scripting (without session and $PHP_AUTH...). If yes - how do I keep track of an authorised user and unauthorised user, so that he should not be validated again. Does setting the user variable to global in all the pages do the trick.?

View Replies !   View Related
User Authentication And PHP Saving As Specific User.
the users of my server had to upload their pages by sftp and only the user who uploaded a page was able to edit itafterwards.

I've been asked to make a secure way for users to log on through the web and edit their pages online. However, although using .htaccess to authenticate users, the script saves as user 'nobody' and is not able to edit pages previously uploaded (and saved as user 'john_doe'). What I am trying to do is make the script save using the same username as the user used to log on.

View Replies !   View Related
Fill Fields When User Selects User From DB
I have a field with a selectbox which contains a list of client names and several other fields which display information from the DB.

I need to be able to make the fields change to the appropriate information when a user is selected from the select box. Can anybody please give me an example of a bit of code that will do this?

View Replies !   View Related
Access Denied For User 'user'@'localhost'
First time using mysql, I keep getting this error:

Access denied for user 'user'@'localhost' to database 'databaseName'


PHP Code:


$conn = mysql_connect('localhost', 'user', 'xxxxxx');
if (!$conn)
    {die('Could not connect: ' . mysql_error() . '<br>');
    }
else
    {echo 'Connection to mysql server made <br>'
    }
$db = mysql_select_db('databaseName', $conn);
if (!$db)
    {die('Cannot connect to database: ' . mysql_error() . '<br>');
    }
else
    {echo 'Connected to database'
    }

View Replies !   View Related
If Register_globals Is Turned 'off', Will USER A Display The $user ?
Scenario: User posts information to a page from a web form. USER A PHP Code:

//remember, a form POSTed information here
echo 'User is '.$user;

USER B. PHP Code:

$user = $_POST['user'];
echo 'User is '.$user;

If register_globals is turned 'off', will USER A display the $user ? If register_globals is turned 'on', will both users display $user ?

View Replies !   View Related
Who Is Online?
i want to show how many visitors are on my homepage "index.php" at the same time. i do not want nor do i need them to register for membership or anything. i just want to simply show how many people are on at the same moment.

View Replies !   View Related
Whose Online
I'd like to find and use a PHP script that like Vbulletin can display a list of those who are online within a set limit of time. I see the opposing language by MS plastered all over the net (dont post the a word as I trued -a.p in my search so others smart like myself in their search may find this page in the future).

Anyway does anyone have or know of such a php script? The reason I can't continue using it is because the chgdir is messing with my another script. I do not know how to reset chgdir once set and no one has posted that. If they did I'd not have to post this alternatively.

View Replies !   View Related
Who's Online?
How do you determine how many users are logged into a site at once or viewing a certain page? Obvious examples are all over this board. If I use a session or cookie, how do I wipe it clean when the user closes his browser?

View Replies !   View Related
Who's Online...
i'm going to build a who's online for a client, but I have a problem. I don't know how to do it with this kind of db. (done by a past programmer). Here it is

+----------------+--------------+
+ user_id + int(11) +
+----------------+--------------+
+ real_time + datetime +
+----------------+--------------+

now i don't understand, if i wanted to collect all users active in the last 5 minutes, how i would go about doing this because what the db does is stores them, and when they were last active. Any ideas on how to do it? (DB is MySQL) (PHP 4.3.11)

View Replies !   View Related
Users Online Help!
I have a column in my datasase and whenever you login, it sets it to "yes". The Users online just retrieves all users that have "yes" in that column. However, the only way to get the user off the Users Online list (make the column "no") is to go via logout. I don't want this to be the users only choice. I want the online column in the database to be set to "no" if they have been on a page for 30 minutes. Now I figured out most of the code, but I can't seem to find a way to track the number of minutes (or any time) that the user has been on the page. I tried incorporation JS but I can't get that to work. I tried cookie's but I got nothing. BTW: I'm using sessions so $_SESSION['online'] controls the online status.

Can someone please help me track the minutes the user has been on the page?

View Replies !   View Related
Who's Online - Timestamp
i am trying to make a "whos online" type thing. the following code returns all members as being online within the last 5 mins, but i dont think my "$last_hit" variable is working properly a when i return it i get "Resource id #3" i have tried:

$last_hit[0]
and
$last_hit[0][0]

but neither seem to work, anyone have any ideas ? PHP Code:

View Replies !   View Related
Online Questionnaire
i need to create an html questionnaire form that depending on how many correct answers the user answers a different message will display. how do i go about doing that in PHP?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved