Jump to content

ddanielsmith07

New Members
  • Posts

    1
  • Joined

  • Last visited

ddanielsmith07's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi everyone. I'm having a bit of trouble with my registration script. When I go to my action.php file, I get these error: Notice: Undefined index: uname1 in C:\xampp\htdocs\series\action.php on line 2 Notice: Undefined index: pword1 in C:\xampp\htdocs\series\action.php on line 3 But, When I test my script, Everything works fine. I don't understand what's going on. These are my two files: index.php: <html> <body> <form action="action.php" method="post"> Username: <input type="text" name="uname1" /> Password: <input type="password" name="pword1" /> <input type="submit" value="Login" /> </form> </body> </html> action.php: <?php $username_1 = $_POST['uname1']; $password_1 = $_POST['pword1']; $con = mysql_connect("localhost", "root", ""); if (!$con) { die('Could not connect: '. mysql_error()); } mysql_select_db("user1", $con); mysql_query("INSERT INTO userlogin (username, password) VALUES ('$username_1', '$password_1')"); mysql_close($con); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.