Reputation: 117
I want to run this line of code in a php if statement.How would I do this?
if (mail("[email protected]",$subject,$ipmessage,$header) ==1){
echo "Thank You Your Message Has Been Sent!";
<meta http-equiv="refresh" content="3;url=index.php">
}
Upvotes: 1
Views: 763
Reputation: 4017
Try this code with header redirect after certain time interval.
<?php
ob_start();
if (mail("[email protected]",$subject,$ipmessage,$header)){
echo "Thank You Your Message Has Been Sent! ";
header("Refresh: 10; url=index.php"); //You will be redirect in 10 seconds
}
ob_flush();
?>
Upvotes: 0
Reputation: 26732
if (mail("[email protected]",$subject,$ipmessage,$header)){
echo "Thank You Your Message Has Been Sent!";
?>
<meta http-equiv="refresh" content="3;url=index.php">
<?php
}
?>
For HEADER in php --
FINAL EDIT -
if (mail("[email protected]",$subject,$ipmessage,$header)){
echo "Thank You Your Message Has Been Sent!";
header("Refresh: 3;index.php");
}
Upvotes: 2