Re: passing control to a separate script
| From: | tedd | Date: | Mon, 02 May 2011 02:25:55 +0000 |
| Subject: | Re: passing control to a separate script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312615@lists.php.net to get a copy of this message | ||
At 9:17 PM -0400 5/1/11, Jim Giner wrote:
I have a large script that does a certain function for me. I have a second script that gets called and does its thing and when I'm done with it I'd like to pass control to the first script. I don't need this 'included' in my second script - I just want to pass control to it and let it take over again. Is this do-able?Yes, this is do-able. But don't be afraid of the include statement. Here's an example that can be easily made to do what you want: http://www.webbytedd.com/bb/php-run-php/ After the first script runs, it includes the second script that then runs, which then includes the first script to continue. If you don't want to use a $_POST to trigger the critter, then use location, such as: // first script if($to_second_script) { header('Location: http://www.example.com/second.php'); exit(); } // second script if($to_first_script) { header('Location: http://www.example.com/first.php'); exit(); } Either those will work depending upon the trigger you need. Cheers, tedd -- ------- http://sperling.com/