PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1847
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
where to add confirm password tag Posted by bae on 21 Jun 2009 at 7:47 AM
this is form tag


<form id="form1" name="form1" method="post" action="afterlog.php">
<table width="399" border="1" align="center" cellpadding="2" cellspacing="1" bordercolor="#000000">
<tr>
<td width="127" bgcolor="#fbcbf7">Username</td>
<td width="194"><label>
<input name="username" type="text" id="username" size="10" />
</label></td>
</tr><tr>
<td bgcolor="#fbcbf7"> Password</td>
<td><input password="password1" type="password" id="password1" size="10" /></td>
</tr><tr>
<td bgcolor="#fbcbf7"> Confirm Password</td>
<td><input password="password2" type="password" id="password2" size="10" /></td>
</tr><tr>
<td bgcolor="#fbcbf7"> E-mail</td>
<td><input name="Email" type="text" id="Email" size="30" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="button4" id="button4" value="submit" />


<input type="reset" name="button3" id="button3" value="cancel" /></td>
</tr>
</table>
</form>


and


this is error code

<?php
include('connect_login.php');
if($_POST['button4']){
$username = $_POST['username'];
$password1 = $_POST['password1'];
$password2 = $_POST['password2'];
$Email = $_POST['Email'];
}
$sql = "INSERT INTO `text`.`see` (`id` ,`username` ,`password` ,`E-mail` )VALUES ('', '$username', '$password1', '$Email');";
mysql_query($sql);
?>


my question is how to add password in database by what code?
Report
Re: where to add confirm password tag Posted by tradm on 22 Jun 2009 at 1:04 AM
Your code is OK. If it cant save in the database, it could be because the connection the file connect_login.php could not be found or the mySQL username, password or servername are incorrect.

make sure the table see in database text exists. If field id is auto increment then change your SQL from $sql = "INSERT INTO `text`.`see` (`id` ,`username` ,`password` ,`E-mail` )VALUES ('', '$username', '$password1', '$Email');"; to $sql = "INSERT INTO `text`.`see` (`id` ,`username` ,`password` ,`E-mail` )VALUES (NULL, '$username', '$password1', '$Email');";

Report
Re: where to add confirm password tag Posted by bae on 22 Jun 2009 at 1:34 AM
table is exist but $password1 not available in sql database due to i can not define variable correctly.
my question is asking how to correct the variable between confirm password($password2) and password($password2)
Report
Re: where to add confirm password tag Posted by tradm on 22 Jun 2009 at 2:35 AM
Ok. On the form, change

<input password="password1" type="password" id="password1" size="10" />

to

<input name="password1" type="password" id="password1" size="10" />

Report
Re: where to add confirm password tag Posted by bae on 22 Jun 2009 at 5:48 AM
thxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX q



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.