Search code examples
phphttprequestisset

isset() differences between 5.2 and 5.4


I seem to be running into an issue where a server running PHP 5.2 that runs the following code fine.

<?php

if (isset($mobile , $email , $key , $srcKey) && $srcKey === 'test') {
    echo(sha1(($mobile.$email.$key)));
}
else {
    die('Invalid Values');
}

?>

When the following request is posted to the script, everything works fine on my 5.2 server:

http://www.test.com/php/script.php?email=caiger01%40hotmail.co.uk&mobile=07446337910&key=xpLOlsGyZq2NM4eYPUVHn8EJ9ahVfj9O&srcKey=test

However on PHP 5.4 it seems that the isset statement returns as false regardless?


Solution

  • Seems you are using register globals, which should not be used and have been deprecated & removed from PHP 5.4.

    http://php.net/manual/en/security.globals.php