Error I tried this page to run on local, it is running perfectly fine but showing me a warning on uploading. What might be the reason.
I used session as per given in w3schools..
The session_start() function must
appear BEFORE the tag
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should not write any data to the response body before invoking PHP functions which may modify the response headers.
For example, do not do:
but rather do
The
session_start()may need to set a cookie in the response header. That’s only possible if the response body has not been sent/flushed yet. Why it works in local environment is probably because the response buffer is larger there (server-dependent configuration). Regardless of the buffer size, you should always do this kind of tasks, which possibly modifies the response headers, in the very top of the PHP file, before any character is been written to the response body.