cr-ispinternet Posted May 5, 2008 Share Posted May 5, 2008 Hi All, I recently ported an applicationf rom PHP4 tp PHP5 and have had the most amount of trouble ever its custom written so ive not really followed the future proof guide ( which ill have to now though ) any way, something as simple as this doesnt seem to work can any one help me... ?> <!-- J2 and Smooth Customer Logout Start --> <a href="<?echo("logout.php?login=$login"); ?>"><img border="0" src="images/logout-tab.jpg" width="168" height="24"> <!-- J2 and Smooth Customer Logout Finish --> <? which after that give me this on the http://line http://backend.domain.co.uk/logout.php?login=Asherlock The reason for this is it then tell this code to do a certain routine for logout likie record the time and various other bits and bobs before it destroys the session and logs out <?PHP include('includes/connection.php'); // Login Status variable $login_status= '0'; // Mysql query to set login status to logged out $query = "update j2_users set login_status= '$login_status' where user='$login'"; $result = mysql_db_query('j2database',$query); while($row = mysql_fetch_object($result)) { } // Mysql query to select current login ip and time $query2 = "SELECT * from j2_users WHERE user='$login'"; $result2 = mysql_db_query('j2database',$query2); while($row = mysql_fetch_object($result2)) { $display_current_ip = "$row->current_remote_address"; $display_current_login = "$row->current_login"; $display_first_name = "$row->first_name"; } // Mysql query to update last login woth current login before logout $query3 = "update j2_users set last_login= '$display_current_login', last_remote_address= '$display_current_ip' where user='$login'"; $result3 = mysql_db_query('j2database',$query3); while($row = mysql_fetch_object($result3)) { } This used ti work find in PHP4 but it will not work in PHP5 does any one know why it would appear that the $login is notbeing passed to the top line as when trying to echo out $login there nothing there, its classed as an undefined variable.... any ones inout would be most usefull Alan Quote Link to comment Share on other sites More sharing options...
cr-ispinternet Posted May 5, 2008 Author Share Posted May 5, 2008 Simple one... Register Globals = Off ( default in PHP5 ) turn register globals to On ( although this is not recomcomended ) i have managed to get the app working till i can dev it in to PHP5 Alan Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted May 5, 2008 Share Posted May 5, 2008 Register globals were turned off by default in php4.2 in the year 2002. So, this is not really a php4 vs php5 problem. Register globals have been removed in php6, so you will need to fix the code before php6 is released. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.