Jump to content

help migrating from php 4 to php 5 now with register globals off


kalster

Recommended Posts

i am having problems converting a php 4 script with register globals on to a php 5 without registered globals enabled. i use the following code for the $_get, $_post data at the top of the php files.

 

 

if (!empty($_GET)){
extract($_GET);
}else if (!empty($HTTP_GET_VARS))
{extract($HTTP_GET_VARS);
}if (!empty($_POST))
{extract($_POST);
}else if (!empty($HTTP_POST_VARS))
{extract($HTTP_POST_VARS);
}

 

but the problem is with the $table->id variable. i do not no how to make the id work as it is giving me script errors. i do not no what the "->" refers to in the $table->id. do i have to change all the id to sessions? is the original id stored as $id? a quick fit to this script would be very beneficial. thank you in advanced.

Edited by kalster
Link to comment
Share on other sites

You haven't told us what the code you showed us is supposed to do. You also haven't shown us any code with $table in it, even though you are talking about it in your comments. And finally, you haven't told us what the errors you are receiving are, or shown us the code that the errors refer to.

 

And finally, help here is free, and comes at its own speed. If you are looking for quick fixes, there is a freelance section where you can hire people to help. Otherwise you can be patient and work at our speed. But it will help speed things up if you are clear and concise with your questions, and show the relevant code (and only the relevant code) for your issues.

Link to comment
Share on other sites

the $table->id code is suppose to store the id of the user from the mysql database. showing the code for the $table->id will not help any because i do not know what php file the id is defined as but anyways here is the code. the error i am getting is "trying to get property of none object".

 

 

if(isset($table))
{ $table  =  $table->row();
echo 'http://localhost/preview.php/'. $table->id);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.