Hi,
I'm having trouble passing form variables from one site to another. (Same domain, though)
To keep it simple (stupid :p ), I have 1 input-field and I'd like to pass that value to the next page.
The code is as follows:
File1: Making sure the form is on a https-site
<?php
$MerchantNumber = "xxxxxxx";
echo "<form method=\"POST\" action=\"https://pay.dandomain.dk/securetunnel.asp?MerchantNumber=". $MerchantNumber ."&tunnelurl=http://www.vindstat.dk/temp1.php?MerchantNumber=". $MerchantNumber ."\" name=\"Form\"\">";
echo " <input type=\"submit\" value=\"Send\">";
echo "</form>";
?>
File2: Posting the form and input field
<?php
echo "<form method=\"POST\" action=\"https://pay.dandomain.dk/securetunnel.asp?MerchantNumber=". $MerchantNumber ."&tunnelurl=http://www.vindstat.dk/temp2.php?MerchantNumber=". $MerchantNumber ."\" name=\"Form\"\">";
echo "<input type=\"text\" name=\"asdf\">";
echo "<input type=\"submit\" value=\"Send\">";
echo "</form>";
?>
File3: Echoing the value entered in the input field in File2
<?php
$test = $_POST['asdf'];
echo "Test: ".$test;
?>
$test turns out to be empty..
Anyone have an idea why this is the case?
Thanks for reading 🙂