Xenous
o shi
- Nov 15, 2011
- 383
- 101
So I'm a noobie at php and I'm trying to some basic input forms, and here's my problem.
Notice: Undefined index: user in C:\xampp\htdocs\index.php on line 13
Notice: Undefined index: pass in C:\xampp\htdocs\index.php on line 14
and my code is
so what have I done wrong?
Notice: Undefined index: user in C:\xampp\htdocs\index.php on line 13
Notice: Undefined index: pass in C:\xampp\htdocs\index.php on line 14
and my code is
PHP:
<html>
<head>
<title>
Okay lets do this
</title>
</head>
<body>
<?php
include ('db.php');
?>
<?php
$user = strip_tags(mysql_real_escape_string($_POST['user']));
$pass = strip_tags(mysql_real_escape_string($_POST['pass']));
mysql_query ("INSERT INTO `users` (`username`, `password`) VALUES ('{$user}', '{$pass}')");
?>
<form method="post"/>
Username: <input type="textbox" name="user" />
Password: <input type="textbox" name="pass"/>
</form>
</body>
</html>