Entires duplicate automatically
Posted: Sun Feb 13, 2011 10:30 am
Hi everyone.
I have a login form with two parameters (username and password). password is with md5 encryption. Also I have devoloped a system to enter users and pass word into this MYSQL database. Problem is when I enter a new user name and a password through the system that i have devoloped, each entry duplicates by many numbers(ex:4 and next time greater than that). Can some one help.
Regards
Shehan31
I have a login form with two parameters (username and password). password is with md5 encryption. Also I have devoloped a system to enter users and pass word into this MYSQL database. Problem is when I enter a new user name and a password through the system that i have devoloped, each entry duplicates by many numbers(ex:4 and next time greater than that). Can some one help.
Code: Select all
<html>
<!--<img src="logoad.jpeg" width="100%" height="140" /> -->
<div id="logo"></div>
<style>
#logo{
}
</style>
</html>
<?php
$connect = mysql_connect ("localhost","root","") or die ("error");
mysql_select_db ("guestbook") or die ("eroor connecting Database");
$queryget = mysql_query ("select * from login " ) or die (" error with table");
while($row=mysql_fetch_assoc($queryget)){
$user=$row['user'];
$pass=$row['password'];
if (isset($_POST['Confirm'])){
$user1=$_POST['Username'];
$password1= md5($_POST['Password']);
if($user1==$user){
echo"The Username exsist. Can't complete the entry.";
}else{
$querypost = mysql_query (" INSERT IGNORE INTO login VALUES ('','$user1','$password1')");
echo"sucessfully completed";
}
}
}
echo"
<div id='second_table' style='float:left; width:800px; position:absolute; top:185px; right:0px;'>
<form action = 'adduser.php' method='post'>
<tr>
<td>
<font size='5' face='times new roman' color='18ff19'>New_Username</font>
</td>
<td>
<input type='text' name='Username' maxlength='200'>
</td>
</tr>
<tr>
<td></br></br>
<font size='5' face='times new roman' color='18ff19'>New_Password</font>
</td>
<td>
<input type='password' name='Password' maxlength='200'>
</td></br></br>
</tr>
<tr>
<td align='center' valign='top' colspan='2'>
<input type='submit' name='Confirm' value='Confirm' >
</td>
</tr>
</form>
";
?>Regards
Shehan31