Code: Select all
<?php
session_start();
?>
<HTML>
<BODY>
<?php
$sess_var = 100;
if(session_register(“sess_var”))
echo "Its happening";
else
echo "You might as well SMC";
echo "<br>". $sess_var ."<br>";
echo "<br>". $_SESSION["sess_var"] ."<br>";
?>
</BODY>
</HTML>
Code: Select all
Its happening
100
$HTTP_SESSION_VARS also gives the same result. What could be the problem.
Also when I start the page, a warning appears saying that there could be an incompatibilty issue.
Code: Select all
Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0
Please help me out. I'm a newbie and am very interested to learn PHP.
Thanks a mega lot.