Page 3 of 3
Re: $_GET and $_REQUEST causing Internal Server Errors
Posted: Sun Aug 01, 2010 7:40 pm
by lala
I also have $_GET problem after using php5.3.1, but php 5.0.5 work well.
i have put .php?.. in my code too...( but need add $_GET)
May be you can try to get rid of $_GET in certain php file if you use lower php version like php 5.0
Re: $_GET and $_REQUEST causing Internal Server Errors
Posted: Mon Aug 02, 2010 1:51 pm
by PeteA
Fixed,
Right, it was partly the install. They found that the auto installer for the server failed to install the correct files properly.
Next part using the following also sorted the second half of the issue.
Code: Select all
<?
// Check if variable is in the url and that it is not empty
if (isset($_GET['var']) && $_GET['var'] != "") {
$var = $_GET['var'];
}
?>
For reference, a lot of windows providers seem to globally turn error reporting off, this means it will return an Internal Server Error (500) instead of giving you the error. So the way round this is to use iiset().
Personally I didn't think to use the $_GET inside of the isset() until it was mentioned to me by one of the hosting companies developers who managed to find the problem with the server.
Re: $_GET and $_REQUEST causing Internal Server Errors
Posted: Tue Aug 03, 2010 6:58 am
by superdezign
Code: Select all
if (isset($_GET['var']) && $_GET['var'] != "") {
This is equivalent to:
PHP's
empty() function checks if a variable is not set and, if it is set, it checks if it is empty.