Jump to content


Photo

FPUT in background??


  • Please log in to reply
3 replies to this topic

#1 fmp

fmp
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 August 2006 - 02:29 PM

Hey all :)

I've a script that takes POST data, processes it in several ways, then sends the data off in a "repost" using fput to another website address, then makes its ending response.


The fputting is all done via a custom function.  But depending on the remote site, this can take a few seconds to process.


I want to be able to run my custom fput function, then just continue script execution.  As opposed to waiting for fput function to finish.


I've done some searching, the only thing I could turn up were "exec" tricks.  I wanted to avoid such methods. 

Doesn't PHP have a simple way of executing commands/functions in the background?  Wow that would speed a lot of things up for the end-user.


Thank you in advance for your help!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 23 August 2006 - 02:36 PM

Doesn't PHP have a simple way of executing commands/functions in the background?


Put simply, no. You could however look into forking though it is NOT recomended within a web server environment and in most cases would actually be disabled on a shared server.

#3 fmp

fmp
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 August 2006 - 03:37 PM

Well thats just silly :)  But I can understand the nature of such a feature would prolly be a lot more complicated in implementation than it is in idea


Back to the drawing board  ::)

#4 lessthanthree

lessthanthree
  • Members
  • PipPipPip
  • Advanced Member
  • 85 posts
  • LocationUK

Posted 23 August 2006 - 03:47 PM

Have you looked at running some sort of Javascript implementation...I hate using the word, but some kind of AJAX methodology sounds like what you require here.....

In simple terms, you can have a javascript run on your main page, that sends any requests to a php page running in the "background"...the JS page is able to make changes to the page a viewer is seeing when the php has finished.
call me a safe bet, i'm betting i'm not




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users