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

Edited by jeffshead
Link to comment
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?

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.