the_real_JLM Posted March 26, 2008 Share Posted March 26, 2008 as seen in my earlier thread answered by Ken (thanks), I am using header to redirect after submitting a form. I need the redirect to open in the parent window, not the current frame. Here is what I tried, and failed ofcourse <?php $post_array = array('name' => '', 'drivers' => 'Drivers License: ', 'position' => 'Position Applying For: ', 'address' => 'Address: ', 'message' => ''); if (isset($_POST['submit'])) { $email = $_POST['email'] ; $tmp = array(); $tmp['name'] = ''; foreach ($_POST as $key => $val) switch($key) { case 'firstname': case 'lastname': $tmp['name'] .= $val . ' '; break; case 'email': $email = stripslashes($val); break; case 'submit': break; default: $tmp[$key] = trim(stripslashes($val)); } $tmp2 = array(); foreach ($post_array as $key => $lbl) $tmp2[] = ($lbl != '')?$lbl . stripslashes($tmp[$key]):$tmp[$key]; mail( "[email protected]", "Online Job Application",implode("\n",$tmp2)."\n" , "From: $email" ); header( "Location: http://blah.com/index.php" target='_Parent' );} ?> Notice at the end I added target='_Parent', to no avail Link to comment https://forums.phpfreaks.com/topic/98025-postdata-header-target/ Share on other sites More sharing options...
soycharliente Posted March 26, 2008 Share Posted March 26, 2008 AFAIK, you cannot do this. Whatever your reason for using a frame is, I'm sure that it can be done without using it making what you're actually trying to do with the header MUCH easier. Link to comment https://forums.phpfreaks.com/topic/98025-postdata-header-target/#findComment-501560 Share on other sites More sharing options...
the_real_JLM Posted March 26, 2008 Author Share Posted March 26, 2008 Actually I cant avoid the frame. Its in a CMS. Unless I rebuild the whole website... lol. That would take like a month lol. So theres no way to do this? Link to comment https://forums.phpfreaks.com/topic/98025-postdata-header-target/#findComment-501601 Share on other sites More sharing options...
soycharliente Posted March 26, 2008 Share Posted March 26, 2008 Maybe if we got into a really long discussion about what CMS you're using, how the page is formatted, etc. we might come up with something really sloppy or even something really good. I don't know. The one suggestion that I can make to you is, have the header redirect to a thankyou.php page or something that would show up inside the frame. Have some text and put a link right underneath it that is formatted exactly how you need it. Thank you for filling out our form. Blah blah blah. <a href="index.php" target="_parent">Please click here or this page will self destruct.</a> How does that fit your fancy? lol Link to comment https://forums.phpfreaks.com/topic/98025-postdata-header-target/#findComment-501617 Share on other sites More sharing options...
the_real_JLM Posted March 26, 2008 Author Share Posted March 26, 2008 Maybe if we got into a really long discussion about what CMS you're using, how the page is formatted, etc. we might come up with something really sloppy or even something really good. I don't know. The one suggestion that I can make to you is, have the header redirect to a thankyou.php page or something that would show up inside the frame. Have some text and put a link right underneath it that is formatted exactly how you need it. Thank you for filling out our form. Blah blah blah. <a href="index.php" target="_parent">Please click here or this page will self destruct.</a> How does that fit your fancy? lol Yea I was just thinking that. I'll make one with an auto redirect body tag, assuming specifying parent works in that lol thx for ur input Link to comment https://forums.phpfreaks.com/topic/98025-postdata-header-target/#findComment-501639 Share on other sites More sharing options...
the_real_JLM Posted March 26, 2008 Author Share Posted March 26, 2008 got it beat: <html> <head><meta http-equiv="refresh" content="2;url=javascript:window.open('index.php','_parent');"> <title>Job Application</title> </head> <p align="center">Application recieved, redirecting to main Hodder.ca index...<br> Please click <a href="index.php" target="_parent">here</a> if this takes longer than 10 seconds. </p> </body> </html> Link to comment https://forums.phpfreaks.com/topic/98025-postdata-header-target/#findComment-501668 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.