Max Gee
Max Gee

Reputation: 117

How do I run a meta tag using php?

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

Answers (2)

iLaYa  ツ
iLaYa ツ

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

swapnesh
swapnesh

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

HEADER

FINAL EDIT -

 if (mail("[email protected]",$subject,$ipmessage,$header)){
    echo "Thank You Your Message Has Been Sent!";
    header("Refresh: 3;index.php");
  }

Upvotes: 2

Related Questions