Home > Archive > PHP Programming > September 2004 > Calling HTML page passing parameters as POST_VARS
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Calling HTML page passing parameters as POST_VARS
|
|
| Franco Fellico' 2004-09-20, 3:57 pm |
| I have a PHP program (wich is only a processing program, in other
words a PHP program not included in a HTML code) and I need to start
from this PHP program a HTML page passing it a set of parameters.
The HTML page that I need to start is an existing page that I can't
modify; it need to receive the parameters in a POST_VARS shape so my
PHP program must be able to send the parameters in that way.
It's possible to realize this? If yes, can someone help me and suggest
me a solution ?
Thank you from Franco in Italy
| |
|
|
?
I think you'll have to explain some more, as your request is unclear.
If the target for your POST is a plain HTML document, what is the
point? The POSTed variables will be ignored. Perhaps what you really
have is an HTML document with a <FORM> and you want to auto-fill and
submit this form. If that is the case, you will want to examine the
ACTION parameter of the form to find the name of the form processor and
direct your POSTed variables to this processor.
---
Steve
| |
| Franco Fellico' 2004-09-22, 3:56 am |
| "Steve" <googlespam@nastysoft.com> wrote in message news:<1095696035.839034.249420@h37g2000oda.googlegroups.com>...
> ?
>
> I think you'll have to explain some more, as your request is unclear.
>
> If the target for your POST is a plain HTML document, what is the
> point? The POSTed variables will be ignored. Perhaps what you really
> have is an HTML document with a <FORM> and you want to auto-fill and
> submit this form. If that is the case, you will want to examine the
> ACTION parameter of the form to find the name of the form processor and
> direct your POSTed variables to this processor.
>
> ---
> Steve
Sorry if I was unclear.
My problem is:
I have two different pages (page1 and page2) that I must call from a
form in a initial page where there are tho textfields and two buttons
(Button1 and Button2).
I only like to call page1 (and passing it the two textfield) on click
of Button1 and page2 (always passing it the two textfield) on click of
Button2.
I can use PHP to do this or only HTML if is able to realize this need.
Thank you. Franco
| |
| Simon Stienen 2004-09-22, 3:56 am |
| Franco Fellico' <Franco Fellico' <ffellico@inwind.it>> wrote:
> My problem is:
>
>
> I have two different pages (page1 and page2) that I must call from a
> form in a initial page where there are tho textfields and two buttons
> (Button1 and Button2).
>
> I only like to call page1 (and passing it the two textfield) on click
> of Button1 and page2 (always passing it the two textfield) on click of
> Button2.
Use one script to check, whick button has been pressed and then include one
of the pages:
if (isset($_POST['button1'])) include('page1.php');
else include('page2.php');
If you really want two different URIs for the pages, you should use two
completely different forms with two different action handlers.
You could "forward" POST data by sending a form filled with hidden fields
to the user and transmitting it automatically using JavaScript. However,
this is a very ugly way and you really should use one of the above, if
possible.
--
Simon Stienen <http://dangerouscat.net> <http://slashlife.de>
»What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done.«
-- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle
| |
| Nikolai Chuvakhin 2004-09-22, 3:57 pm |
| ffellico@inwind.it (Franco Fellico') wrote in message
news:<d8b4dc5c.0409212234.501c720c@posting.google.com>...
>
> I have two different pages (page1 and page2) that I must call from a
> form in a initial page where there are tho textfields and two buttons
> (Button1 and Button2).
>
> I only like to call page1 (and passing it the two textfield) on click
> of Button1 and page2 (always passing it the two textfield) on click of
> Button2.
Assuming that target pages can only accept input via POST, but not GET,
this is best done in JavaScript, I think:
<form method="post" action="page1" name="myform">
<input type="text" name="field1">
<input type="text" name="field2">
<input type="submit" value="Button1">
<input type="submit" value="Button2"
onClick="myform.action='page2'; myform.submit()">
</form>
Cheers,
NC
| |
| Franco Fellico' 2004-09-27, 3:57 pm |
| nc@iname.com (Nikolai Chuvakhin) wrote in message news:<32d7a63c.0409220714.67d9686c@posting.google.com>...
> ffellico@inwind.it (Franco Fellico') wrote in message
> news:<d8b4dc5c.0409212234.501c720c@posting.google.com>...
>
> Assuming that target pages can only accept input via POST, but not GET,
> this is best done in JavaScript, I think:
>
> <form method="post" action="page1" name="myform">
> <input type="text" name="field1">
> <input type="text" name="field2">
> <input type="submit" value="Button1">
> <input type="submit" value="Button2"
> onClick="myform.action='page2'; myform.submit()">
> </form>
>
> Cheers,
> NC
-----------------
Hello friends.
Thanks for your help, but in my case the PHP programs don't work. And
I would like to use PHP and not Javascript.
The problem is that I need to call two different CGI (not HTML code).
So I can't use a PHP INCLUDE statement.
So I need some statement that from PHP can start two different Bash
Script wich in turn will start two different AcuCobol programs.
How I can do this ?
It's possible to insert in the process PHP program statements that can
start bash scripts (in other words my CGI's).
Thanks again. Franco.
| |
| Tim Van Wassenhove 2004-09-27, 3:57 pm |
| In article <d8b4dc5c.0409270535.7fafd860@posting.google.com>, Franco Fellico' wrote:
> So I need some statement that from PHP can start two different Bash
> Script wich in turn will start two different AcuCobol programs.
http://www.php.net/exec and related functions
--
Tim Van Wassenhove <http://www.timvw.info>
|
|
|
|
|