Jump to content

Deprecated: Function session_is_registered() is deprecated in....


jimweldon

Recommended Posts

 

Hi,

 

My host upgrade PHP yesterday and broke some code on my site. My developer is not avail...

 

 

ERROR MSSG:

 

Deprecated: Function session_is_registered() is deprecated in...followed by directory

 

Here's the live of code that contains the error.

 

if(!isset($_POST[$param_name]) && !isset($_GET[$param_name]) && session_is_registered($param_name))

 

 

 

Im assuming it has to do with "session_is_registered". Any ideas? Thx.

}

 

function get_session($param_name)

{

  $param_value = "";

  if(!isset($_POST[$param_name]) && !isset($_GET[$param_name]) && session_is_registered($param_name))

    $param_value = $_SESSION[$param_name];

 

  return $param_value;

}

 

I need to modernize the code. Any ideas. thx.

 

 

}

 

function set_session($param_name, $param_value)

{

  if(session_is_registered($param_name))

    session_unregister($param_name);

  $_SESSION[$param_name] = $param_value;

  session_register($param_name);

}

 

  • 2 years later...

This morning I opened my site to find this at the top of the page:

 

 

Deprecated: Function session_is_registered() is deprecated in /home/trafficr/public_html/config.php on line 37

 

Deprecated: Function session_register() is deprecated in /home/trafficr/public_html/members/index.php on line 9

 

I tried replacing session_is_registered with $_SESSION but that completely broke the site. I am not sure what to do. I am not a php coder and know nothing about it. This is a traffic exchange that has a lot of members, so I want to fix it as quickly as possible.

 

Any ideas?

This morning I opened my site to find this at the top of the page:

 

 

Deprecated: Function session_is_registered() is deprecated in /home/trafficr/public_html/config.php on line 37

 

Deprecated: Function session_register() is deprecated in /home/trafficr/public_html/members/index.php on line 9

 

I tried replacing session_is_registered with $_SESSION but that completely broke the site. I am not sure what to do. I am not a php coder and know nothing about it. This is a traffic exchange that has a lot of members, so I want to fix it as quickly as possible.

 

Any ideas?

 

 

Try replacing function session_is_registered() with:

 

 

if(isset($_SESSION[''])){
}

// replace whatever is in the (*) on the original inside the ['*'] on the new

as well, replace function session_register() with this line:

$_SESSION['*'] = $_REQUEST['*'}

// Replace the asterisks with what was in the parentheses in the original

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.