Browser Problem

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: macek, egami, gesf

lakshmi
New php-forum User
New php-forum User
Posts: 2
Joined: Fri Oct 01, 2004 10:38 pm

Browser Problem

Postby lakshmi » Fri Mar 18, 2005 3:31 am

Hi

I am working as webdevloper using PHP,MYSQl.

When i close my browser i want run THis coding

"$online="update user_profile set online_status=1 where user_email='".$_SESSION['USEREMAIL']."'";
$status=mysql_query($online);"

How can write that.Please help me any one..

Thanks & Regards

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Postby swirlee » Fri Mar 18, 2005 10:56 am

You can't run a PHP script when the user closes the browser.

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Thu Mar 24, 2005 6:10 pm

You can use sessions for that!

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Fri Mar 25, 2005 2:50 am

actully when the broser is closed -- the scrpt is terminated.. therefore you sohuld set have a last_Active column in your DB... on every action made by user -- update the database with the current unix date..

This might be the easiest way to do it..


Return to “PHP & MySQL Security”

Who is online

Users browsing this forum: No registered users and 0 guests

cron