Hi, I'm new to PHP. Hope someone able to help me with this problem.
-------------db_connect.html---------------
<html>
<head>
<title>User Authentication</title>
</head>
<body>
<form METHOD = "POST" ACTION = "db_connect.php">
<p><strong>Username:</strong><br>
<INPUT TYPE = "text" NAME = "username" SIZE = 30></p>
<p><strong>Password:</strong><br>
<INPUT TYPE = "text" NAME = "password" SIZE = 15></p>
<p><INPUT TYPE = "submit" NAME = "submit" VALUE = "Submit"></p>
</form>
</body>
</html>
--------------db_connect.php--------------
<?php
if(($_POST[username] == " ") || ($_POST[password] == " "))
{
header("Location: db_connect.html");
exit;
}
$user = $_POST[username];
$pass = $_POST[password];
//get the connection to the database
$connection = @mysql_connect("localhost", $user, $pass)
or die(mysql_error());
?>
I receive notice warning about username and password variables.
Use of undefined constant username - assumed 'username' in d:\easyphp1-7\www\db_connect.php on line 3
Use of undefined constant password - assumed 'password' in d:\easyphp1-7\www\db_connect.php on line 3
Can anyone explain why I receive these warnings even though the two variables do hold some values?
Thanks for any help,