I want to start by saying that: you are wrong! That is not the reason that you see that warning. The reason is that you started the session before, and then you started it again. So look in your code for 2 lines with "session_start()"
. Even if this is not right, session_start()
must be the first line in your script!!!
Now to answer your question!
There are 2 ways to do this:
disable warnings from php.ini
Open PHP.ini file.
In this file search for the phrase “ error_reporting = E_ALL” ,[without inverted commas]
Here replace this with “error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING “
(Show all errors, except for notices and coding standards warnings)
Make sure you change the real enabled part of this , there are certain other examples given in the file.
Restart your PHP + Apache
use the error_reporting()
function in PHP like is described in the PHP manual HERE
But I must warn you, nither of this are considered good practice. It is not ok to disable warning, notice or error messages.
Hope this helps! :D