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
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
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:
<!doctype html>
<?php session_start(); ?>
...
but rather do
<?php session_start(); ?>
<!doctype html>
...
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.