- May 13, 2003
- 13,704
- 7
- 81
I am trying to prep a new LAMP server, but I'm getting weird results from it. In the following code, on one server everything works correctly, but on the server I have created (with Ubuntu server 9.10) I literally get nothing. When the submit button is clicked, the form just refreshes itself. No error messages, nothing.
What would cause a simple form not to respond on LAMP server?
What would cause a simple form not to respond on LAMP server?
PHP:
<html>
<head>
<title>Auth Test...</title>
</head>
<body>
<?php
$form_login = "
<form name=\"form_login\" method=\"POST\" action=\"$PHP_SELF\" >
<div>
<label for=\"username\">Username:</label>
<input type=\"text\" name=\"username\" value=\"$username\" />
<br />
<label for=\"password\">Password:</label>
<input type=\"password\" name=\"password\" value=\"$password\" />
<br />
<input type=\"hidden\" name=\"l_written\" value=\"yes\" />
<input type=\"submit\" name=\"submit\" value=\"submit\" />
</div>
</form>
";
if ( $l_written != "yes")
{
echo $form_login;
}
else if ( $l_written == "yes" )
{
if ( $username == "" )
{
$error_user = "Please enter yoru username or netID.</br />";
$ready = "no";
}
if ( $password == "" )
{
$error_passwd = "Plesae enter your password.<br />";
$ready = "no";
}
if ( $ready != "no" )
{
$ldap = ldap_connect('matrix.txstate.edu');
if ( $ldap )
{
$result = @ldap_bind( $ldap, 'txstate\\'.$_POST['username'], $_POST['password']);
if ( $result && !empty($_POST['password']))
{
echo "<strong>Logged in.</strong>";
$_SESSION['status'] = "valid";
}
else
{
echo "<strong>Incorrect login.</strong>";
echo $form_login;
$_SESSION['status'] = "invalid";
}
}
}
else if ( $ready == "no" )
{
echo $error_user;
echo $error_passwd;
echo $form_login;
}
}
?>
</body>
</html>