Ad:
 
  • PHP Discussion Thread
  • Unsolved
  • Views: 705
  • PHP RSS
Similar Threads
May 4th, 2009
0

Warning: Unknown: I'm Stumped!

Expand Post »
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
moonie9 is offline Offline
2 posts
since May 2009
May 4th, 2009
0

Re: Warning: Unknown: I'm Stumped!

this is an easy but hard fix.
If you are using the session_register("name"); You need to upgrade it to the $_SESSION['name'] = "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
Reputation Points: 12
Solved Threads: 5
Junior Poster
itisnot_me is offline Offline
126 posts
since Apr 2009
May 4th, 2009
0

Re: Warning: Unknown: I'm Stumped!

Click to Expand / Collapse  Quote originally posted by itisnot_me ...
this is an easy but hard fix.
If you are using the session_register("name"); You need to upgrade it to the $_SESSION['name'] = "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.
Sponsor
Reputation Points: 528
Solved Threads: 263
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
May 4th, 2009
0

Re: Warning: Unknown: I'm Stumped!

Click to Expand / Collapse  Quote originally posted by ShawnCplus ...
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
Reputation Points: 12
Solved Threads: 5
Junior Poster
itisnot_me is offline Offline
126 posts
since Apr 2009
May 5th, 2009
0

Re: Warning: Unknown: I'm Stumped!

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'] = $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")
Reputation Points: 10
Solved Threads: 0
Newbie Poster
moonie9 is offline Offline
2 posts
since May 2009
This thread is more than three months old. Perhaps start a new thread instead?
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Build Custom RSS Feed


Follow us on Twitter


© 2010 DaniWeb® LLC