Advertisement

10.30.2005 at 11:34PM PST, ID: 21613558
[x]
Attachment Details

Submitting Forms with PHP

Asked by bradderick in PHP Scripting Language

Tags: forms, php

Hi All,

I'm fairly new to php and i'm not sure if it's easy to do this in PHP or not but here is what I'm trying to do:

Have a form on page A which submits to page B (a php page). Page B automatically adds several form variables and then posts the form data through to Page C.

To be more specific:

The Form on Page A:

<FORM METHOD="POST" ACTION="http://www.myserver.com/pageB.php" onSubmit="return ValidateForm(this)" >
<input type="hidden" name="unit1" value="dataone">
<input type="hidden" name="unit2" value="1">
<TABLE cellpadding="3" cellspacing="3">
<TR><TD><strong>First Name</strong> </TD><TD><input TYPE="text" name="name"  size="20"></TD></TR>
</table>
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit">
</form>

Then this will submit to Page B. Page B will then automatically append some more hidden form fields based on the value of 'unit2' from the page before (so unit2 could be 1, it could be 2, 3 etc).

So, lets say the value is 1 and we then need to append:

<input type="hidden" name="unit3" value="phone">
<input type="hidden" name="unit4" value="address">

Then this page B should automatically post ALL the form data (including the data from Page A) to a new address, http://www.anotherserver.com/recipient.php

I would rather that Page B posts all the form data using PHP rather than using Javascript.

If you have any suggestions please let me know.

Thanks!

BradStart Free Trial
[+][-]10.30.2005 at 11:45PM PST, ID: 15191099

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 12:09AM PST, ID: 15191151

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 02:10AM PST, ID: 15191595

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 06:14AM PST, ID: 15192651

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 06:14AM PST, ID: 15192654

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: forms, php
Sign Up Now!
Solution Provided By: xive
Participating Experts: 5
Solution Grade: A
 
 
[+][-]10.31.2005 at 06:15AM PST, ID: 15192658

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 08:16PM PST, ID: 15198216

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.31.2005 at 08:50PM PST, ID: 15198294

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.01.2005 at 05:32AM PST, ID: 15199746

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.06.2005 at 08:13PM PST, ID: 15236657

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32