pstanbra Posted October 20, 2006 Share Posted October 20, 2006 Hey - If sum1 cud help me u will ease my headache.I have a html posting to php outlined below. However based on form input, php will redirect to a paymeent page. However I want to take all the variables from the previous form onto the payment gateway form...here is my php file:$Message = ""; if (!is_array($HTTP_POST_VARS)) return;reset($HTTP_POST_VARS); while(list($key, $val) = each($HTTP_POST_VARS)) { $GLOBALS[$key] = $val; if (is_array($val)) { $Message .= "<b>$key:</b> "; foreach ($val as $vala) { $vala =stripslashes($vala); $Message .= "$vala, "; } $Message .= "<br>"; } else { $val = stripslashes($val); if (($key == "Submit") || ($key == "submit")) { } else { if ($val == "") { $Message .= "$key: - <br>"; } else { $Message .= "<b>$key:</b> $val<br>"; } } } } // end while$Message = "<font face=verdana size=2>".$Message;mail( $MailToAddress, $MailSubject, $Message, "Content-Type: text/html; charset=ISO-8859-1\r\nFrom: ".$email."\r\nBCc: ".$MailToCC);if(isset($_POST['service'])){ switch($_POST['service']){ default: header("Location:http://www.google.co.uk"); break; case 'PC Health Check': header("Location:http://www.sysfix.co.uk/pay.html"); break; case 'Technical Support': header("Location:http://www.yahoo.co.uk"); break; } } ?>so i basically get emaild a form to email - then a redirect to a payment url - FYI - the form tags relate to the tags expected by the form on the gayeway page.I hope u understand what im trying to address... Quote Link to comment Share on other sites More sharing options...
pstanbra Posted October 21, 2006 Author Share Posted October 21, 2006 eg - i need this header("Location:http://www.sysfix.co.uk/pay.html"); to be likeheader("Location:http://www.sysfix.co.uk/pay.html"[b] ?var1&var2"[/b] Quote Link to comment Share on other sites More sharing options...
alpine Posted October 21, 2006 Share Posted October 21, 2006 [code]<?phpheader("Location: http://www.sysfix.co.uk/pay.php?var=$var&var2=$var2"); exit();?>[/code] Quote Link to comment Share on other sites More sharing options...
pstanbra Posted October 22, 2006 Author Share Posted October 22, 2006 hi - I didnt realise it was that easy.. Well, it's kinda what i'm looking for;so my form sends the variable to a php file which is a form to email script. I then set a redirect based on a form dropdown and have changed the link so it passes the variables on like you said as below ..header("Location:http://www.sysfix.co.uk/pay.html?firstname=$firstname"However the redirect to pay.html also has a form. I've set up all form elements with the same variable names and have marked the elements as hidden so all that remains is a pay now button. How do these variables get passed on??I tried changing my form element to<input name="firstname" type="hidden" id=$firstname> however all i get in the payment field on my card processor is $firstname arghhhany ideas? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.