castor_troy Posted July 3, 2008 Share Posted July 3, 2008 I have a script that sends a file to the client's website through ftp_put. This file is then executed on the client's website using curl. Now, how will I know if that file has already done it's part so I can print out a success message or something? here's my sample code: ftp_put($fh, '/httpdocs/temp.php', 'temp.php', FTP_ASCII); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://clientdomain.com/temp.php?action=do_something"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_exec($ch); curl_close($ch); TIA Link to comment https://forums.phpfreaks.com/topic/113128-how-to-determine-if-the-script-called-by-curl-has-already-finished-executing/ Share on other sites More sharing options...
ratcateme Posted July 3, 2008 Share Posted July 3, 2008 after curl_exec($ch); it has finished. this calls the http request and waits until it is complete. Scott. Link to comment https://forums.phpfreaks.com/topic/113128-how-to-determine-if-the-script-called-by-curl-has-already-finished-executing/#findComment-581174 Share on other sites More sharing options...
castor_troy Posted July 3, 2008 Author Share Posted July 3, 2008 oh I see. So I'll just append the success message at the next line after the curl_close? Link to comment https://forums.phpfreaks.com/topic/113128-how-to-determine-if-the-script-called-by-curl-has-already-finished-executing/#findComment-581185 Share on other sites More sharing options...
discomatt Posted July 3, 2008 Share Posted July 3, 2008 You got it. Link to comment https://forums.phpfreaks.com/topic/113128-how-to-determine-if-the-script-called-by-curl-has-already-finished-executing/#findComment-581202 Share on other sites More sharing options...
castor_troy Posted July 3, 2008 Author Share Posted July 3, 2008 ayt! Thanks guys! Link to comment https://forums.phpfreaks.com/topic/113128-how-to-determine-if-the-script-called-by-curl-has-already-finished-executing/#findComment-581217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.