[PHP] Re: Calling a program
- Date: 30 Nov 2015 10:37 +0000
- From: Tim Streater <tim@xxxxxxxxxxxxxxxx>
- Subject: [PHP] Re: Calling a program
On 30 Nov 2015 at 04:36, Ethan Rosenberg <erosenberg@xxxxxxxxxxxxxxxxxxxx> wrote:
> 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 ...
> echo "<input type='hidden' name='next_step' value='step14' />";
> switch ( $_POST['next_step'] )
> case 'step14':
> } }
> } //end Switch
> The result of this is that program.php runs at the start of the script, and
> step14 is never called.
That's exactly how it is expected to work. The steps are:
1) You give a URL to your browser, which points to a file on a web server.
2) The web server works on that file. All PHP code in that file is executed at that time, in the web server.
3) The resulting output, containing no PHP code whatever, is sent to your browser. That output contains any html that was in your file, and any output generated from echo statements in any PHP that was in your original file.
4) Your browser displays that output as a webpage.
It sounds to me that you are confused about what is happening, and where it is happening.
Cheers -- Tim
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php