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
noobie question
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: noobie question
You will need to user javascript to talk to the window.parent and does what ever you want it to do.
(#10850)
-
stickleback
- Forum Newbie
- Posts: 2
- Joined: Fri Mar 20, 2009 2:27 pm
Re: noobie question
thanks - but I don't understand - sorry....
can you explain a little more?
can you explain a little more?