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

Link to comment
Share on other sites

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.

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.