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

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -