View Full Version : Posting Form with Multiple Actions

05-21-2012, 11:43 AM

I need a bit of help on an issue.

I need to post 4 variables to our server from our clients servers so need to implement the page for them.

So far I have this but cannot get it to parse the data:
(This is a broken down version of the code)

<form action="https://XXXXX.com/payment.asp?u=&p=&ref=&amount=" method=post target="_parent">

Username:<input type=text size=20 name="u" value="XXXXXX">
Password: <input type=text size=20 name="p" value="XXXXXX">
Reference: <input type=text size=20 name="ref" value="XXXXXX">
Amount: <input type=text size=20 name="amount" value="XXXXXX">

I need to take these fields that are entered and submit them into the url before loading it.

Any advice please?

05-21-2012, 02:28 PM
Your 'post' is not in punctuation marks.

.... method="post" target="_parent"

05-21-2012, 03:07 PM
There's also no submit button.

I'm by no means an expert in forms or scripting, but I'm pretty sure you can't use action in this way. Action should contain the script to process the form, then the form itself will send the data or do whatever else.

This form would send the data using PHP and header().
However, sending usernames and passwords over the internet needs to be dealt with properly. What I wrote demonstrates it in its most simplistic form. You need to take real took into internet security.

if (isset($_POST['u'])) {
$user = $_POST['u'];
$pass = $_POST['p'];
$ref = $_POST['ref'];
$amount = $_POST['amount'];

header('location: https://XXXXX.com/payment.asp?u='.$user.'&p='.$pass.'&ref='.$ref.'&amount='.$amount);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<form action="" method="post">
Username:<input type="text" size="20" name="u" value="" />
Password: <input type="text" size="20" name="p" value="" />
Reference: <input type="text" size="20" name="ref" value="" />
Amount: <input type="text" size="20" name="amount" value="" />
<input type="submit" value="Submit" />
<input type="reset" value="Clear" />


05-21-2012, 03:34 PM
That was just a sample script but thanks for your replies. Managed to get it to do what I needed it to using a vbscript file before going to said url.

05-21-2012, 03:57 PM
I'm glad you got it working. Even if you are posting a 'sample' script it still needs to include the correct syntax otherwise it's going to be impossible for anyone to see where the actual problem is :)