I'm fairly new at PHP but up to this point I've been able to fix problems I've come across. My problem is I get this warning at the bottom of my members page after logging in. If you refresh that page it disappears. Here's the warning:

Warning: 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

I have just finished moving this from a different server however they both say in the cpanel that they use the same version of PHP. I didn't have this problem on the last server. I have no idea what this warning stems from.

I also had another error that didn't happen on the last server but did on this one. It was Warning: mysql_fetch_array(): but I fixed that.

I guess my questions are how do I get rid of that top warning and why would this work on one server and not the next? Any help would be appreciated!

Thanks,
moonie9

Recommended Answers

All 4 Replies

this is an easy but hard fix.
If you are using the session_register("name"); You need to upgrade it to the $_SESSION = "1";. that is if you built the site yourself. if this is a packaged software you might have to see if they have an updated version. if you get stuck let me know, i just figured how to change my site

this is an easy but hard fix.
If you are using the session_register("name"); You need to upgrade it to the $_SESSION = "1";. that is if you built the site yourself. if this is a packaged software you might have to see if they have an updated version. if you get stuck let me know, i just figured how to change my site

Actually it should be $_SESSION['name'] = $name which is the equivalent of what session_register('name') does. If you do ="1" then it will be 1 and not what was intended.

Actually it should be $_SESSION['name'] = $name which is the equivalent of what session_register('name') does. If you do ="1" then it will be 1 and not what was intended.

got me again.

well it was just an example i thought he would beable to figure it out

Thanks for the quick responses! Yes it is a package script but I guess I can go through it and change it. So does each of the following instances need to be changed?

session_start();
session_register("id_session");
session_register("password_session");
session_register("name_session");
session_register("address_session");
session_register("city_session");
session_register("state_session");
session_register("zip_session");
session_register("country_session");
session_register("phone_session");
session_register("email_session");
session_register("paymentoption_session");
session_register("refby_session");
session_register("l1_session");
session_register("l2_session");
session_register("l3_session");
session_register("l4_session");
session_register("l5_session");
session_register("l6_session");
session_register("l7_session");
session_register("l8_session");
session_register("l9_session");
session_register("l10_session");
session_register("total_session");
session_register("unpaid_session");
session_register("paid_session");

So this
session_register("id_session");
should be this:
$_SESSION = $id_session
etc? And would that then affect any of this:

$id_session=$_SESSION[id_session];
$password_session=$_SESSION["password_session"];
$rs=mysql_query("Select * from members where ID='$id_session'");
$arr=mysql_fetch_array($rs);
$pass=$arr[9];
$id=$arr[0];

if ($_SESSION["id_session"]!="$id" || $_SESSION["password_session"]!="$pass")

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.