Jump to content

PHP 5.3 to PHP 5.5 code issue?


jeffshead

Recommended Posts

The code snippet below works fine with PHP 5.3 (register_globals = Off) but does NOT give the same results with PHP 5.5:

$verhash = md5($tstamp."salt");
if ($hash != $verhash) {
	$_SESSION['direct'] = 1;
	if(isset($_SESSION['ntrd'])) {
		unset($_SESSION['ntrd']);
	}
	if(isset($_SESSION['rntr'])) {
		unset($_SESSION['rntr']);
	}	
	header('refresh: 0; url=/accessDenied.php');
 	exit;
}
I'm not sure if there is a problem with the above snippet or with some other part of the code but I always get redirected to the 'accessDenied.php' page with PHP 5.5.

 

Can someone tell me if the snippet above would output differently on PHP 5.5?

 

Thanks,

 

Jeff

Link to comment
https://forums.phpfreaks.com/topic/292274-php-53-to-php-55-code-issue/
Share on other sites

After more testing, I don't think the problem is related to the PHP version. I created a new test environment with both versions of PHP and I cannot re-create the issue on my server. The issue must be related to the host provider's server and/or settings. I think it must have something to do with sessions. Any ideas on what settings to look for?

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.