PHP redirect script -


i want redirect site visitors form page b using custom php script following rule: if come page a, redirected url 1, else display content/or url 2. use this:

 <?php $referer = $_server['http_referer']; $rest = substr("$referer", -8); if($rest == "send.php")// if come website page "send.php" { echo "<meta http-equiv=\"refresh\" content=\"0;url=http://google.com\">";  } else { echo "$rest"; include 'content.php';  } ?> 

. can help?

<?php $referer = $_server['http_referer']; if (strpos($referer,'send.php') !== false)  { echo "<meta http-equiv=\"refresh\" content=\"0;url=http://google.com\">";  } else { echo "$rest"; include 'content.php';  } ?> 

instead of meta redirect can use header location.

header("location:http://www.google.com"); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -