Hi All,

I am trying to create a page with 2 text boxes a name and a
password with a submit button.The user must enter his
username and password that is stored in mysql to access the

With the following code i get a successfull connection with
a blank username and password but when i enter a wrong
username and password i get a error that is correct.

   <head><title>MySQL Connection</title></head>
         <div align="centre">
            <form action="<?php echo $_SERVER[PHP_SELF];
?>" method="POST">
               Name: <input type="text"
               Password: <input type="text"
               <br /><input type="submit" value="Submit">
   $db_host = "localhost";
   $db_user = $_POST["txt_name"];
   $db_password = $_POST["txt_password"];
   $db_name = "data";
   $connection = @mysql_connect ($db_host, $db_user,
$db_password) or die ("error connecting");
   echo "connection successful!";

What is the best way to authenticate users against mysql
for login?

http://www.webmail.co.za the South African FREE email service

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to