Forum Moderators: coopster
echo "<form name='login' method='post' onSubmit='return login_md5(this);' action='".basename($HTTP_SERVER_VARS['PHP_SELF']);
echo (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING']!= ''? '?'.$HTTP_SERVER_VARS['QUERY_STRING'] : '')."'>";
I'm really abeginner when it comes to php, so could maybe someone please explain what the second half of the code above does? Is it possible to explain in plain english what this bit of code does?
This is what is known in PHP as a 'system variable'. These are variables that are reserved by PHP to do certain things.
Here is a page I like to keep handy which explains exactly what the variables are and what they do much more clearly than the PHP.net site:
PHP System Variables [phpfreaks.com]
as for the 'isset' reference, the script is saying "If this variable is set then do this.."
If you want to check for a variable that is NOT set, you put '!' in front of it.
If!isset ...
The expression (expr1)? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.