Ok, I am running php 5.4 and when I got the dreaded Fatal error: Function name must be a string in /home2/mydomain/public_html/session.php on line 3 I was like OH, BOY.
Here is the code it is referring to.

<?php
session_start();
session_register("userid");
session_register("name");
//session_register("ID");
//session_register("ID");
?>

<?php
session_start();
session_register("adminid");
session_register("adminname");
//session_register("ID");
//session_register("ID");
?>

Even after I tried changing it to:

<?php
session_start();
$_SESSION("adminid");
$_SESSION("adminname");
//$_SESSION("ID");
//$_SESSION("ID");
?>

I still get an error. Any help or ideas would be awesome.

Well $_SESSION isn't a function, it's an array. It should be called like $_SESSION['value'].

AND session_register has been deprectated in 5.3 and removed in 5.4

commented: Spot on +15

This should work:

<?php
    session_start();
    $_SESSION["adminid"] = 1;
    $_SESSION["adminname"] = "Sutarusu";

    echo "Hi! I am ". $_SESSION["adminname"] .", I have ID #" . $_SESSION["adminid"];

?>

And why is this topic placed in Databases > MySQL?

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.