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...

Recommended Answers

All 3 Replies

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.

can i see other warnings if i make changes in ini file?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.