Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Redirect

  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    35
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Redirect

    For some reason the following code isn't working:
    PHP Code:
    header("Location: index.php");
    exit; 
    Any ideas?

    Cheers!

  • #2
    New Coder
    Join Date
    May 2012
    Posts
    35
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Got it working by placing it into a function. Don't know why it wasn't working without being placed into a function. Anyone have any ideas?

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    That should work unless you have it in some other context or scope.

  • #4
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    738
    Thanks
    20
    Thanked 85 Times in 85 Posts
    try

    PHP Code:
    header('Location: /index.php'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •