-1

hi,
i'm using php 5.3. version for my site development.

If i use this function "session_is_registred()", i' getting message something like warning(not actual warning message) as following
"Function session_is_registered() is deprecated in c:/.../.php"

how can i erodicate this message?
help to accomplish it...

Thnx...

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by fwdean
0

Really you should use something like

if (isset($_SESSION['variable']))

instead as that function will not be available in PHP 6.

For now, you can go change your php.ini file. Look for
error_reporting = E_ALL & E_STRICT
or something like that. Remove the E_STRICT and you will not see those warnings anymore.

0

No, that is a global option. You can change error_reporting on the fly to simply stop the warning for deprecated functions by doing this.

<?php
error_reporting(E_ALL);
// code for session_is_registered();
error_reporting(E_ALL & E_STRICT);

That just stops the warning for your code, then resets it to the default.
Better would be to write your own function for session_is_registered() that sets error_reporting, does the function, then sets error_reporting back.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.