Re: Calling a program
| From: | Ashley Sheridan | Date: | Mon, 30 Nov 2015 20:33:25 +0000 |
| Subject: | Re: Calling a program | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325263@lists.php.net to get a copy of this message | ||
On 30 November 2015 18:27:37 GMT+00:00, Curtis Maurand <curtis@maurand.com> wrote:
>
>you can include the p7a.php in your script or you can
>shell_exec(p7a.php)
>
>$script_result = shell_exec('p7a.php');
>
>There is a lot of useful information here once you get past the snide
>comments at the top.
>
>http://stackoverflow.com/questions/8450696/execute-a-php-script-from-another-php-script
>
>
>
>On 11/29/2015 11:36 PM, Ethan Rosenberg wrote:
>> Dear List -
>>
>> Can you not call a PHP script from a form -- action = 'program.php'?
>
>> In my hands it does not work...
>>
>>
>> I have tried the following
>>
>> include program.php;
>>
>> later in the program ...
>>
>> form
>> .
>> .
>>
>> echo "<input type='hidden' name='next_step'
>> value='step14' />";
>>
>> .
>> .
>> .
>> .
>>
>> switch ( $_POST['next_step'] )
>> {
>>
>> case 'step14':
>> {
>> P7a.php();
>> } }
>>
>> } //end Switch
>>
>> The result of this is that program.php runs at the start of the
>> script, and step14 is never called.
>>
>> I am totally confused.
>>
>> If you need more details, please specify.
>>
>> TIA.
>>
>> Ethan
>>
shell_exec is *not* the right method here. As others have pointed out, it appears there's a
lack of understanding about how the PHP stack works with regards to requests and logic.
Thanks,
Ash
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.