Jump to content

[SOLVED] Application Ported From PHP4 to PHP5, Even the basics arnt working.....


Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.