+ Post New Thread
Results 1 to 6 of 6
Web Development Thread, Send Session and Redirection Headers. in Coding and Web Development; I'm using a PHP Script called AutoIndex version 2 and having a few issues with the problems mentioned below. PHP ...
  1. #1
    Maz
    Maz is offline
    Maz's Avatar
    Join Date
    Dec 2008
    Location
    Redcar, Middlesbrough
    Posts
    142
    Thank Post
    17
    Thanked 9 Times in 8 Posts
    Rep Power
    13

    Send Session and Redirection Headers.

    I'm using a PHP Script called AutoIndex version 2 and having a few issues with the problems mentioned below.

    PHP 5.1 and IIS7 by the way.

    Getting these errors when trying to access the auto index page.

    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\inetpub\wwwroot\docs.php:19) in C:\inetpub\wwwroot\autoindex\index.php on line 61

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\inetpub\wwwroot\docs.php:19) in C:\inetpub\wwwroot\autoindex\index.php on line 61

    Warning: Cannot modify header information - headers already sent by (output started at C:\inetpub\wwwroot\docs.php:19) in C:\inetpub\wwwroot\autoindex\index.php on line 618

    Redirection header could not be sent.
    Continue here: ./autoindex/Changes%20to%20PARS.pdf

    The errors themselves can all be removed as I can just delete the command that is calling for the actions on the mentioned lines - however it doesn't automatically redirect to the correct file and thus the end user has to make an unneccessary click to download the file.

    Any help would be appreciated, and also if you need any more information just post back and i'll try to reply asap.

  2. #2
    Maz
    Maz is offline
    Maz's Avatar
    Join Date
    Dec 2008
    Location
    Redcar, Middlesbrough
    Posts
    142
    Thank Post
    17
    Thanked 9 Times in 8 Posts
    Rep Power
    13
    Rename to index.php - not that you need telling
    Attached Files Attached Files

  3. #3

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,400
    Thank Post
    636
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319
    HTTP headers can only be sent once per request. The error says that headers have already been sent by docs.php on line 19 - so the functions that send headers in index.php won't work.

  4. #4
    Maz
    Maz is offline
    Maz's Avatar
    Join Date
    Dec 2008
    Location
    Redcar, Middlesbrough
    Posts
    142
    Thank Post
    17
    Thanked 9 Times in 8 Posts
    Rep Power
    13
    Scratch that, it works.

    Any way around calling the header twice?

    Sorry for being a pain
    Last edited by Maz; 3rd July 2009 at 02:20 PM.

  5. #5
    Maz
    Maz is offline
    Maz's Avatar
    Join Date
    Dec 2008
    Location
    Redcar, Middlesbrough
    Posts
    142
    Thank Post
    17
    Thanked 9 Times in 8 Posts
    Rep Power
    13
    Still struggling guys, hopefully want to get this finished by today if at all possible.

    Thanks.

  6. #6
    Arcath's Avatar
    Join Date
    Feb 2009
    Location
    Lancashire
    Posts
    971
    Thank Post
    102
    Thanked 116 Times in 101 Posts
    Rep Power
    74
    if you sent any HTML before you set the cookies etc... it wont work.

    so:
    <?php start_session(); ?>
    <html>
    =good

    <html>
    <?php start_session(); ?>
    =BAD

SHARE:
+ Post New Thread

Similar Threads

  1. Smoothwall - Session Timeout?
    By linkazoid in forum Internet Related/Filtering/Firewall
    Replies: 2
    Last Post: 19th March 2009, 01:23 PM
  2. Bulk removal (and addition) of headers and footers in Word
    By dagza in forum How do you do....it?
    Replies: 5
    Last Post: 20th June 2008, 02:16 PM
  3. May conference. Session idea
    By Dos_Box in forum Site Polls
    Replies: 15
    Last Post: 6th May 2008, 04:07 PM
  4. [CLOSED] Bug/Error: Session time out?
    By ITWombat in forum EduGeek.net Site Problems
    Replies: 1
    Last Post: 27th February 2008, 02:12 PM
  5. Limit Session Duration
    By DaveP in forum Wireless Networks
    Replies: 1
    Last Post: 29th March 2007, 08:50 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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