I have a strange problem,
My script looks like this:
<?
if ($HTTP_SERVER_VARS['REQUEST_METHOD']!='POST')
{
?>
<html><body>
<form action="login.php?action=login" method="post">
UserName: <input name="loginUserName"><br>
Password: <input name="loginPassword"><br>
<input type="submit">
</body></html>
<?
}
else
{
switch($action)
{
case login:
ProcessLogin();
die();
case logout:
die();
}
function ProcessLogin()
{
echo "Im inside the function";
}
}
?>
I got the following error when I enter a UserName and a Pass:
Fatal error: Call to undefined function: processlogin() in /path/to/the/file/login.php on line 18
One more thing, although my method inside the html code is POST, when I tried to echo the value of $login I typed:
echo "action: $HTTP_POST_VARS[action]";
it showed nothing !!!!
But when I typed:
echo "action: $HTTP_GET_VARS[action]";
it showed action: login !!!!
Although when I typed
echo "Method: $HTTP_SERVER_VARS[REQUEST_METHOD]";
it showed Method: POST !!!!
Come on, Its make no sense!!!
I tested it on my virtual server (Apache) and on my web server, the same crazy result I got.
My script looks like this:
<?
if ($HTTP_SERVER_VARS['REQUEST_METHOD']!='POST')
{
?>
<html><body>
<form action="login.php?action=login" method="post">
UserName: <input name="loginUserName"><br>
Password: <input name="loginPassword"><br>
<input type="submit">
</body></html>
<?
}
else
{
switch($action)
{
case login:
ProcessLogin();
die();
case logout:
die();
}
function ProcessLogin()
{
echo "Im inside the function";
}
}
?>
I got the following error when I enter a UserName and a Pass:
Fatal error: Call to undefined function: processlogin() in /path/to/the/file/login.php on line 18
One more thing, although my method inside the html code is POST, when I tried to echo the value of $login I typed:
echo "action: $HTTP_POST_VARS[action]";
it showed nothing !!!!
But when I typed:
echo "action: $HTTP_GET_VARS[action]";
it showed action: login !!!!
Although when I typed
echo "Method: $HTTP_SERVER_VARS[REQUEST_METHOD]";
it showed Method: POST !!!!
Come on, Its make no sense!!!
I tested it on my virtual server (Apache) and on my web server, the same crazy result I got.