Ok, now I see.
The problem has nothing to do with the platform on which your servers are running.
This error is in fact not an error. It is a Warning.
Your code can execute without problems even if you get shown a warning.
The Windows server, which is showing the error has the
debug messages turned on, the Linux server apparently does not. So all errors on your Linux server are being suppressed, in order to hide them from your clients.
Adding a @ sign to a function will, in most cases, suppress warnings. This is not advisable however, as this can suppress errors that may help you debug your code. It is better to complete the code without any suppressing errors and disable the
debug messages when putting the web on a live server.
The warning you are being shown is shown when you try to access an array element or a variable that does not exists. In your case you are trying to access an element of the $_GET super-global that has not been sent.
To avoid this warning, try formatting you code somewhat like this:
-
if(isset($_GET['element'])) {
-
$element = $_GET['element'];
-
# Input validation would not be a bad idea either!
-
-
if($element < 5) {
-
echo "Element is less than 5";
-
}
-
else if($elemet > 5) {
-
echo "Element is greater than 5";
-
}
-
else {
-
echo "Element is 5!";
-
}
-
}
-
else {
-
echo "GET variable 'element' was not passed!";
-
}
-