Frage

for example I have current link on which I want to redirect:

   if(stripos($_SERVER['REQUEST_URI'], 'post.php?post=5')!==false){
   //redirect
   }

But if the post ID would be post=55 it will redirect too... How to solve this problem ?

War es hilfreich?

Lösung

Why don't you use $_GET variable?

if (isset($_GET['post']) && $_GET['post'] == 5) {
  ...
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top