Page 1 of 1

PHP email and passing values to another website

Posted: Wed Feb 04, 2009 4:26 pm
by apg1985
Hi Guys

Ive got a form with a button at the bottom, the action of the form goes through to a php script that passes the values in the form to an email. I need to pass one of the values in the form to Netbanx, they say the action should be a unique URL to their site and a unique variable name so a field in their site can call it across.

If I put the URL in the action its not going to go to the php script, is there any way after the php script has sent the email of re-directing to the unique Netbanx URL and passing the value in the same php email script?

If you need any code, please post.

Thanks in advance

Re: PHP email and passing values to another website

Posted: Wed Feb 04, 2009 5:02 pm
by watson516
As long as you don't send any headers in the form's action script, then you can use

Code: Select all

<?php
//Code for sending the email
header('Location: domain.com/page.php?var=val');
?>
That will redirect the browser to the other website with the GET variables.

Re: PHP email and passing values to another website

Posted: Wed Feb 04, 2009 5:04 pm
by Skoalbasher
watson516 wrote:As long as you don't send any headers in the form's action script, then you can use

Code: Select all

<?php
//Code for sending the email
header('Location: domain.com/page.php?var=val');
?>
That will redirect the browser to the other website with the GET variables.
Well you can, you just have to use ob_start and flush right? That's how I do it.