PHP User online tutorial
1 of 2
Ads by Google
http://www.phpeasystep.com/phptu/9.html
Probability Tutorial
Home PHP t ut orials All PHP Tutorials Ad Management
Statistic Tutorial
Step Back
Scripts in PHP
Home > PHP Tutorials PHP User online tutorial
PHP User online tutorial This tutorial show you php script that count how many users are active on your site.
Counter Email System Forum and Guestbook File Upload
Database/SQL Tool For DB2, SQL Server, Derby, Mimer Informix, Oraclé and more www.dbvis.com
$89.99 Reseller Package Start your own Internet Reseller Business Now. Everything Provided www.coopersis.com/reseller
Image Manipulation Login / Members / Password Pagination Encode Script Refresh / Redirection Miscellaneous
Overview In this tutorial create 1 file 1. user_online.php Step 1. Create table "user_online" in mysql in database "test". 2. Create file user_online.php.
MySQL t ut orials All MySQL Tutorials Create, Manage Database using phpMyAdmin Connect to Database Insert Data Select Data
Create table "user_online"
C RE A T E T A BL E `us er_online` ( `s es s ion` c har(1 0 0 ) N O T N U L L default '', `time` int(1 1 ) N O T N U L L default '0 ' ) T Y P E =M yI SA M ;
Edit Database Update Database Delete Database Order Results
PHP Text Edit ors Downloads PHP, MySQl Books Free host ing Forums Cont act
Create file - user_online.php
############### Code
9/24/2008 2:27 PM
PHP User online tutorial
2 of 2
http://www.phpeasystep.com/phptu/9.html
$ tbl_name="us er_online"; // T able name // C onnec t to s erver and s elec t databs e mys ql_c onnec t("$ hos t", "$ us ername", "$ pas s word")or die("c annot c onnec t to s erver"); mys ql_s elec t_db("$ db_name")or die("c annot s elec t D B"); Professional Web 2.0 Programming Eric van der Vlist... Best Price $1.50 or Buy New $26.39
Privacy Information
$ s ql="SE L E C T * FRO M $ tbl_name WH E RE s es s ion='$ s es s ion'"; $ res ult=mys ql_query($ s ql); $ c ount=mys ql_num_rows ($ res ult); if($ c ount=="0 "){ $ s ql1 ="I N SE RT I N T O $ tbl_name(s es s ion, time)V A L U E S('$ s es s ion', '$ time')"; $ res ult1 =mys ql_query($ s ql1 ); } els e { "$ s ql2 =U P D A T E $ tbl_name SE T time='$ time' WH E RE s es s ion = '$ s es s ion'"; $ res ult2 =mys ql_query($ s ql2 ); } $ s ql3 ="SE L E C T * FRO M $ tbl_name"; $ res ult3 =mys ql_query($ s ql3 );
PHP & MySQL Janet Valade Best Price $14.83 or Buy New $19.79
Privacy Information
$ c ount_us er_online=mys ql_num_rows ($ res ult3 ); ec ho "U s er online : $ c ount_us er_online "; // if over 1 0 minute, delete s es s ion $ s ql4 ="D E L E T E FRO M $ tbl_name WH E RE time<$ time_c hec k"; $ res ult4 =mys ql_query($ s ql4 ); mys ql_c los e(); // O pen multiple brows er page for res ult ?>
Random Encode PHP Scripts Convert and protect your PHP scripts to unreadable but still executable. This is a list of tools you can use to protect your PHP code. Learn PHP By Example PHP Scripts & Code Examples, Tutorials, Articles, and much more. www.codango.com/php
Free T-SQL Code and Tips SQL Server coding, T-SQL and query optimization tips - ALL FREE! www.mssqltips.com
PHP Code Library Open Source Code Snippet Library. Free Community for Web Developers. www.daniweb.com/code
Automated Ajax Testing Automated functional testing for Ajax/Web 2.0 applications-Free Eval www.parasoft.com
Hosted by Hostgator © PHPeasystep.com 2005-2007
9/24/2008 2:27 PM