Hello
First sorry for my english
I have a question, I must redirect my customer on another web site after complete a form.
I have a simple form with only two field $nom and $extension and a sumbit button, this form must be validate on another web site 'mywhois.website.fr'
I try 3 method and all works fine inside a 'classic' web site but with Drupal and my theme no way :
In drupal, no error message and no redirect.
1/- Redirect with PHP Header Location
<?
if (isset($HTTP_POST_VARS['submit']))
{
$nom=$HTTP_POST_VARS['domain_name'];
$extension=$HTTP_POST_VARS['tld'];
header("Location: https://mywhois.website.fr/index.php?domain_names=".$nom.".".$extension."");
?>
2/- Redirect with Javascript
<?php
function js_redirect($url, $seconds=0) {
echo "<script language=\"JavaScript\">\n";
echo "<!-- hide code from displaying on browsers with JS turned off\n\n";
echo "function redirect() {\n";
echo "window.location = \"" . $url . "\";\n";
echo "}\n\n";
echo "timer = setTimeout('redirect()', '" . ($seconds*1000) . "');\n\n";
echo "-->\n";
echo "</script>\n";
return true;
}
if (isset($HTTP_POST_VARS['submit']))
{
$nom=$HTTP_POST_VARS['domain_name'];
$extension=$HTTP_POST_VARS['tld'];
js_redirect("https://mywhois.website.fr/index.php?domain_names=".$nom.".".$extension."" ,0);}
?>