To All a Welcome,

All the errors are gone but this nagging one.  I am running a login script
and getting this error...

To bring the username and password into the processing script I am doing it
this way, and having trouble.
I have spent too many hours working on this one issue.  Please help someone.
Blessings, Chetan


Notice: Undefined index: myusername in
C:\Inetpub\wwwroot\AimsSite\docproedit\checklogin.php on line 12

Notice: Undefined index: mypassword in
C:\Inetpub\wwwroot\AimsSite\docproedit\checklogin.php on line 13
The login script is simple HTML using..... 

<form name="Flogin.html" method="post" action="login.php">
<input name="myusername" type="text" >
<input name="mypassword" type="password" >
<input type="button" value="submit" >

Note: "Flogin.html is name of Login page script; login.php is name of script
below, processing the pass and user."

Here is the Code...

*********Function Login.php Begin End************  
** Process username 1st by md5, then Encrypt,
** then compare with appropiate password in DB.                             
//----Basic connecting $vars----
session_register("myusername"); session_register("mypassword");
$db_name='aims site'; $tbl_name='docproedit'; $db_server='localhost';
$auth = false;
//----Encrypting begins for username and password
//----entered by the user on login page.
//----The hash function, which includes the encrypt function.
function hashinput($uname,$pname){
global $user; global $pass; global $uname; global $pname; global $p;
if (!isset ($_POST['myusername']) ||($_POST['myusername'] !='myusername'))
//----the Encrypt function.
function Encrypt($string) {$Encryption = crypt(md5($string),
md5($string));return $Encryption;} 
$user = encrypt($usrname);
$p = encrypt($passname);
//----Connecting with DB, selecting array from DB to analyze.
$linkID = mysql_connect($db_server, $db_user, $db_pass);
mysql_select_db("$db_name", $linkID);
$result = mysql_query("SELECT password FROM docproedit WHERE username =
'$user'", $linkID);
$pass = mysql_fetch_row($result);
//----Based on the comparision of encryped "login" username
//----against the permanent DB password, $auth is 1 if 'good' login, and 0
if 'bad'.
if ($pass[0] === $p) {
$auth = true;
if ($auth = 1) { 
echo "<meta http-equiv=\"Refresh\"
return $auth;

*************Function Loginphp End***************  

View this message in context:
Sent from the Php - Database mailing list archive at

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to