Current location: Hot Scripts Forums » Programming Languages » PHP » how to run php script in background...


how to run php script in background...

Reply
  #1 (permalink)  
Old 04-08-05, 12:28 AM
upendrakumar upendrakumar is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Red face how to run php script in background...

how to run php script in background which inserts some values in mysql database without refreshing the current.
i want to track a user time who is currently using my elearning site, want to update and insert the used time in the database

needy for the script urgently
take thanks in advance

upendra (india)
Reply With Quote
  #2 (permalink)  
Old 04-08-05, 12:53 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
there are two solutions that I can think of..
one is xmlHTTPRequest (Javascript) or Forking (may not work)
1- for xmlHTTPRequest, read:
http://developer.apple.com/internet/...mlhttpreq.html

2- for forking:
http://www.phpfreaks.com/tutorials/71/0.php
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 04-08-05, 01:16 PM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
XMLHttpRequest is like the new black these days. It is probably the better and more reliable option, if you can hack it out. Of course, users can still just turn javascript off on their browsers...
Reply With Quote
  #4 (permalink)  
Old 04-10-05, 10:37 AM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
after a brief reading, i stopped. this tutorial deals nothing with forking a process. assigning the child process to /dev/null is not what a fork means to be since nobody gains control over the script (it only "dumps" the output through a background process).

anyway, here is a good intro for (posix) thread programming (thread vs. fork, mutexes, pipe, etc). this would give some explanation about forking and threading process, the background and the technique.
__________________
just an ignorant noob with moronic solution...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
trying to create my first simple (?) php script, need guidance HotShotPhoto PHP 1 09-06-04 08:12 PM
Run PHP Script Within PHP Script Reg PHP 1 06-29-04 09:09 AM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 12:31 AM
Affiliate script (PHP) whtiebear Job Offers & Assistance 2 12-21-03 12:12 AM


All times are GMT -5. The time now is 06:38 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.