insert new user
Posted: Thu Jun 07, 2012 1:11 am
Hi all,
i am, now creating for insert new user, like username and password. and now i have no idea in how to code a correct syntax in php that when i input different password it well be ignore and must be the password are equal. please help me a little idea. take a look code below.
i am, now creating for insert new user, like username and password. and now i have no idea in how to code a correct syntax in php that when i input different password it well be ignore and must be the password are equal. please help me a little idea. take a look code below.
Code: Select all
<div class = "octagon_class0001010001">
<form method = "POST">
<div class = "octagon_class0001010002">
<div id = "octagon_id0001010003">
User Teype:
<select name = "usertype" style = " width:250px; height:20px; float:right;">
<option>User</option>
<option>Administrator</option>
</select></div>
<div id = "octagon_id0001010003">User Name:<input type = "text" name = "username" style = " width:250px; height:15px;float:right;"/></div>
<div id = "octagon_id0001010003">User Password:<input type = "password" name = "password" style = " width:250px; height:15px;float:right;"/></div>
<div id = "octagon_id0001010003">Re-Type Password:<input type = "password" name = "re_password" style = " width:250px; height:15px;float:right;"/></div>
<div id = "octagon_id0001010003"><input type = "submit" name = "add_user_sub" value = "add user" style = " width:100px; height:25px;float:right;"/></div>
</div>
</form>
</div>
</div>
<?php
include "../config/jph-config.php";
if(isset($_POST['add_user_sub']))
{
$_my_user_type = $_POST['usertype'];
$_my_user_name = $_POST['username'];
$_my_password = $_POST['password'];
$_my_re_password = $_POST['re_password'];
mysql_query("INSERT INTO `tbl_user`(usr_type,usr_name,usr_pass,re_usr_pass) VALUES ('$_my_user_type','$_my_user_name','$_my_password','$_my_re_password')");
}
?>