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 7 of 7
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question redirection not working properly??

    i have made a session based redirection ie when the authentication is valid then it redirects to the certian page.when i used the
    PHP Code:
    header("Location:target.php"); 
    it shows header already sent by......problems .then i used HTML redirection(using meta tags)then the page redirects but its shows the same "header already sent by..." message in intermediate form(ie when the page is Loading)..wht's the problem i m not gettin Please Help

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    the code seems correct, do you have a link to the page? Some things that might cause this are some type of security software. NIS2005 does this sometimes.

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Location
    Tokyo, Japan
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try putting an absolute path for Location:.

    i.e.
    PHP Code:
    header("Location: http://localhost/target.php"); 
    Yak

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts
    That error means you have output something to the browser before redirecting. Post all your code for more help.

  • #5
    New to the CF scene
    Join Date
    May 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the code is seems correct but the problem is in your php.ini configuration .

    In the PHP.ini file you must set the variable output_buffering

    [output_buffering = on]

    and then the code will run

  • #6
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,778
    Thanks
    19
    Thanked 155 Times in 146 Posts
    If all else fails, or you just want an easy way out of this jam, you could just use this line of javascript instead:

    Code:
    <script>document.location='target.php'</script>
    I do this sometimes when I don;t feel like dealing with session/header/buffer issues....
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #7
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Thanks man!

    thnks all of u for helping me


  •  

    Posting Permissions

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