kalster Posted January 9, 2013 Share Posted January 9, 2013 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. Link to comment https://forums.phpfreaks.com/topic/272883-help-migrating-from-php-4-to-php-5-now-with-register-globals-off/ Share on other sites More sharing options...
haku Posted January 9, 2013 Share Posted January 9, 2013 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 https://forums.phpfreaks.com/topic/272883-help-migrating-from-php-4-to-php-5-now-with-register-globals-off/#findComment-1404368 Share on other sites More sharing options...
kalster Posted January 9, 2013 Author Share Posted January 9, 2013 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 https://forums.phpfreaks.com/topic/272883-help-migrating-from-php-4-to-php-5-now-with-register-globals-off/#findComment-1404371 Share on other sites More sharing options...
cpd Posted January 9, 2013 Share Posted January 9, 2013 Are you using CodeIgniter? That code has one to many brackets. The bracket after $table->id isn't needed. Link to comment https://forums.phpfreaks.com/topic/272883-help-migrating-from-php-4-to-php-5-now-with-register-globals-off/#findComment-1404388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.