Remove the session_start() from inside the for loop.
Put the session_commit() outside the for loop at the very end.
Both these functions should only be called once in a script.
More Related Contents:
- Cannot modify header information [duplicate]
- Returning JSON from a PHP Script
- How to fix “Headers already sent” error in PHP
- Why I have to call ‘exit’ after redirection through header(‘Location..’) in PHP?
- PHP page redirect [duplicate]
- Why won’t my PHP app send a 404 error?
- Header only retrieval in php via curl
- correct PHP headers for pdf file download
- Prevent sent emails treated as junk mails using php mail function
- Warning: Cannot modify header information – headers already sent by ERROR [duplicate]
- Symfony2 – Force file download
- PHP, display image with Header()
- Creating a PHP header/footer
- PHP header(Location: …): Force URL change in address bar
- php, file download
- PHP header() redirect with POST variables [duplicate]
- How to pass variables received in GET string through a php header redirect?
- PHP headers already sent [duplicate]
- How to send a status code in PHP, without maintaining an array of status names?
- PHP header location-redirect doesn’t work – why? [duplicate]
- What is the format for e-mail headers that display a name rather than the e-mail?
- HTTP response code after redirect
- header location not working in my php code
- Which line break in php mail header, \r\n or \n?
- Authorization header missing in PHP POST request
- Show Curl POST Request Headers? Is there a way to do this?
- PHP get pdf file from base64 encoded data string
- Download of .zip file runs a corrupted file php
- PHP Streaming MP3
- How to cause a redirect to occur before php script finishes?