I just transferred a PHP website from a Linux server to Windows. Everything seems to function the same except one huge difference:
On the Linux server, the following piece of code is ignored when $_GET['action']
is not set:
$action = $_GET['action'];
if($action=='add'){
echo 'good';
}
However, this prevents the page from loading on the Windows server.
What does work is:
if(isset($_GET['action'])){
$action = $_GET['action'];
}else{
$action='';
}
if($action=='add'){
echo 'good';
}
2 questions:
Is there a way to configure the server to be more forgiving of variables that don't have a value?
Is the second code example better practice?