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!
<?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!