Forum Moderators: coopster
When the submit button is clicked from any one site, the data is submitted to a CRM and it should redirect to the appropriate site. The CRM has the redirect page link which will be used after storing the data.
How do I pass the button name to this php page, since it's not called directly from the submit page?
if ($buttonHit == 'c4r')
{
header( "Location: $site1url" );
exit ;
}
else
{
header( "Location: $site2url" );
exit ;
}
Can someone help?
[edited by: CoolBuddy at 9:39 pm (utc) on April 8, 2009]
header("content-type:text/html\n\n");
var_dump($_POST);
Or, if it's not post, use $_GET. You can use $_REQUEST which will print out either, but IMO it's important to use one or the other so you know what your program will expect.
If your script is not working, it's just in how the variable $buttonHit is being set.
I set the cookie using javascript SetCookie("Button", "c4r"); with half a minute expiry.
Then used the php server side script to check the cookie.
if ($_COOKIE["Button"] == "c4r")
{
header( "Location: $site1url" );
exit ;
}
else
{
header( "Location: $site2url" );
exit ;
}
This works.