MyBB Community Forums

Full Version: PHP 301 redirect with message???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I show a message on homepage if the user has landed on homepage from 301 redirect????



P.S.

I have found this solution could you tell me if this will could somehow compromise my security?


I will use this for 301 redirect!

    header("HTTP/1.1 301 Moved Permanently");
    header("Location: {$mybb->settings['bburl']}?redirect=true");
    exit();


And use this PHP code to show message after redirect! Plugin hooked to index_start

 if(isset($_GET['redirect'])){
if($_GET['redirect'] == 'true'){
echo"<div class='redirected'>You were redirected!</div>";
}
}

What do you think is there a way to make it better????
Thanks I found the way to do it.