Hello. I’m new to PHP. ?
I am trying to use the PHPlist manager for my e-mail lists and I’m running into problems with trying to redirect to the custom thank you page(s).
I’m trying to call this PHP snippet in the form element, but not sure how to setup the form to do so.
[code=php]function redirect($url) {
if (!headers_sent()) {
//If headers not sent yet… then do php redirect
header(‘Location: ‘.$url); exit;
} else {
//If headers are sent… do javascript redirect… if javascript disabled, do html redirect.
echo ‘<script type=”text/javascript”>’;
echo ‘window.location.href=”‘.$url.'”;’;
echo ‘</script>’;
echo ‘<noscript>’;
echo ‘<meta http-equiv=”refresh” content=”0;url=’.$url.'” />’;
echo ‘</noscript>’; exit;
}
}
Another member was kind enough to give me the snippet, but kind of left me hanging with how to use it the snippet bleow:
[code=php]
$url = “/redirect.php”; // This is the variable with the URL
redirect($url); // This is using the variable in the function
From here, I’m not sure where to go next so I’m hopen that one of you other fine people would help me out?
Any help would be greatly appreciated.
Thanks
Brian