noobie question
Posted: Fri Mar 20, 2009 2:34 pm
hi - this ios my first post - so please be gentle!
his is my first venture "under the hood" of php and so far so good
I've got a "pop up" window on my web page with a sign up form for a newsletter, which writes the details to a database.
Once this is done the script has a redirect funtion which is working - taking my visitor to the "thank you" page.
Now here's the problem - the "thank you page" is loading in the popup window - and what I want is for it to load in the original page (I guess the parent page). Ideally I'd like the script to close the popup window, too, but that might be asking too much.
Here's the bit of code which handles the redirect (I hope I'm posting it correctly)
// redirect to landing page if specified
if (!empty($_REQUEST['Landing_Page_URL'])) {
if (LOGFILE && LOG_LEVEL == 2) error_log(date('Y-m-d H:i:s') .
' Redirecting subscriber to ' . $_REQUEST['Landing_Page_URL'] .
"\n", 3, LOGFILE);
// save $_POST to session var for accessibility after the jump
$_SESSION['POST'] = $_POST;
//$data = simplexml_load_string($xml);
//$location = $data->id; // URL to the newly created Contact object
//echo $data->id;
header('Location: ' . $_POST['Landing_Page_URL']);
exit;
} else {
$output .= "
<h1>You have been added to our list.</h1>
<p>Thank you for subscribing.</p>
<p>Please <a href=\"" . SITE_HOME . "\">CLICK HERE</a> to return to our main page.</p>";
}
I'm guessing I need to put the php equivalent of target = " _parent" somewhere but I'm not sure what that php would be or where to put it...
any and all help much appreciated
his is my first venture "under the hood" of php and so far so good
I've got a "pop up" window on my web page with a sign up form for a newsletter, which writes the details to a database.
Once this is done the script has a redirect funtion which is working - taking my visitor to the "thank you" page.
Now here's the problem - the "thank you page" is loading in the popup window - and what I want is for it to load in the original page (I guess the parent page). Ideally I'd like the script to close the popup window, too, but that might be asking too much.
Here's the bit of code which handles the redirect (I hope I'm posting it correctly)
// redirect to landing page if specified
if (!empty($_REQUEST['Landing_Page_URL'])) {
if (LOGFILE && LOG_LEVEL == 2) error_log(date('Y-m-d H:i:s') .
' Redirecting subscriber to ' . $_REQUEST['Landing_Page_URL'] .
"\n", 3, LOGFILE);
// save $_POST to session var for accessibility after the jump
$_SESSION['POST'] = $_POST;
//$data = simplexml_load_string($xml);
//$location = $data->id; // URL to the newly created Contact object
//echo $data->id;
header('Location: ' . $_POST['Landing_Page_URL']);
exit;
} else {
$output .= "
<h1>You have been added to our list.</h1>
<p>Thank you for subscribing.</p>
<p>Please <a href=\"" . SITE_HOME . "\">CLICK HERE</a> to return to our main page.</p>";
}
I'm guessing I need to put the php equivalent of target = " _parent" somewhere but I'm not sure what that php would be or where to put it...
any and all help much appreciated