PDA

View Full Version : PHP Help: redirect and frames


Albert Lewis
01-23-2004, 06:32 PM
Alright i have this really cool php text message script on my site here is the code..

<?php
if($sentmessage == "2"){
echo "sorry!, you have already submitted twice";

}else{

$num = $sentmessage + 1;
setcookie("sentmessage","$num",time()+86400); //set the cookie

$to = "theemailaddress@domain.com";
$subject = "$email , $msg";

$mailheaders = "From: $email \n";
$mailheaders .= "Reply-To: $email\n\n";

mail($to, $subject, $msg, $mailheaders);

?>
<html><head><title>I have recieved your message</title></head><body>

Thank you, i have recieved your message.
</body>
</html>
<?

}//end submitted


?>


There is the problem, when it works fine, and it creates the html page "Thank you i have recieved your message" (which at this point is inside a frame) any link you click on that should load in that window, loads in a new window so it totaly messes up my site....

Same with if there is a error and you have sent twice today...

How could i 1) Redirect my vistors to a html page that would work fine. or 2) fix this problem with in the php file.

Any help would be GREAT thanks!

Viper007Bond
01-23-2004, 08:23 PM
Step one: Take a giant fork and stab the frame in the i (get it? iframe? :D)

Step two: include() (http://www.php.net/include/)

Example:

http://test.viper007bond.com/gear/ - all of the pages include a common header file

Much better than making frames for your top and bottom or whatnot.

Albert Lewis
01-24-2004, 04:44 AM
true love does exist

Viper007Bond
01-24-2004, 06:26 AM
I'll never, ever go back to iframes. lol