Jump to content


Photo

sessoin_register


  • Please log in to reply
4 replies to this topic

#1 hamza

hamza

    Advanced Member

  • Members
  • PipPipPip
  • 320 posts

Posted 04 May 2010 - 09:38 AM

i am getting error
Fatal error: Call to undefined function session_register()
how i can resolve this??

#2 Alex

Alex

    Advanced Member

  • Staff Alumni
  • 2,469 posts
  • LocationStony Brook, New York

Posted 04 May 2010 - 09:41 AM

You should not be using session_register in the first place. It's depreciated as of PHP 5.3.0. Instead use $_SESSION

session_start();
$_SESSION['var'] = 'val';

session_start

:anim_rules:Read the rules, :rtfm: and don't forget to use [code] / [php] tags!


#3 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 04 May 2010 - 09:47 AM

Edit: Basically says the same as above ^^

session_register(), session_is_registered(), and session_unregister() were depreciated 8 years ago, finally throw a depreciated error in php5.3, and have been completely removed in php6. You should not even know there is a function named session_register(). Either someone disabled it in your php version or you are using php6.

To set or reference a session variable, you use the $_SESSION array (also requires a session_start() statement on any page the sets or references a session variable) -

$_SESSION['some_name'] = some_value;

if(isset($_SESSION['some_name'])){
    // do something if the variable is set
    echo $_SESSION['some_name'];
}




Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.

#4 hamza

hamza

    Advanced Member

  • Members
  • PipPipPip
  • 320 posts

Posted 04 May 2010 - 10:03 AM

Edit: Basically says the same as above ^^

session_register(), session_is_registered(), and session_unregister() were depreciated 8 years ago, finally throw a depreciated error in php5.3, and have been completely removed in php6. You should not even know there is a function named session_register(). Either someone disabled it in your php version or you are using php6.

To set or reference a session variable, you use the $_SESSION array (also requires a session_start() statement on any page the sets or references a session variable) -

$_SESSION['some_name'] = some_value;

if(isset($_SESSION['some_name'])){
    // do something if the variable is set
    echo $_SESSION['some_name'];
}






if a project is already coded in old php version and using old function .
then what is the possible solution for it to remover these errors.

#5 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 04 May 2010 - 10:21 AM

Given that the function is not present in the php version you are using and the code won't work at all, the solution is to update the code to current php standards.

Ref: http://en.wikipedia....iki/Deprecation
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com