below is my code
Quote
<?php
$username=$_POST['username'];
$pwd=$_POST['pwd'];
$repeat_pwd=$_POST['repeat_pwd'];
$name=$_POST['name'];
$email=$_POST['email'];
if(!empty($username)){
$db=@new mysqli
("linux3","zongyan.huang","zongyan.huang","zongyanhuang");
if(mysqli_connect_errno()){
echo"connect fail<br>\n";
echo mysqli_connect_error();
exit;
}
insert into t_user
('f_username','f_password','f_name','f_email') values
('$username','$password','$name','$email');
$rs=$db->query($sql);
if(!$rs){
$db->close();
echo 'insert fail';
exit;
}
echo"<font color='red'
size='5'>congulations</font><br>\n";
$db->close();
}
?>
<html>
<head>
<title>regisetr form</title>
</head>
<body>
<?php
if(!empty($username)){
echo "your information is<br>\n";
echo "username:$username<br>\n";
echo "pwd:$pwd<br>\n";
echo "repeat_pwd:$repeat_pwd<br>\n";
echo "name:$name<br>\n";
echo "email:$email<br>\n";
}
?>
<form name="frmRegister" method="post"
action="register.php">
<table width="330" border="0" align="center"
cellpadding="5" bgcolor="#eeeeee">
<tr>
<td width="40%">username</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td>password</td>
<td><input name="pwd" type="password" id="pwd"></td>
</tr>
<tr>
<td>repeat password</td>
<td><input name="repeat_pwd" type="password"
id="repeat_pwd"></td>
</tr>
<tr>
<td>name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>email</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="submit">
<input type="reset" name="reset" value="reset"></td>
</tr>
</table>
</form>
</body>
</html>
$username=$_POST['username'];
$pwd=$_POST['pwd'];
$repeat_pwd=$_POST['repeat_pwd'];
$name=$_POST['name'];
$email=$_POST['email'];
if(!empty($username)){
$db=@new mysqli
("linux3","zongyan.huang","zongyan.huang","zongyanhuang");
if(mysqli_connect_errno()){
echo"connect fail<br>\n";
echo mysqli_connect_error();
exit;
}
insert into t_user
('f_username','f_password','f_name','f_email') values
('$username','$password','$name','$email');
$rs=$db->query($sql);
if(!$rs){
$db->close();
echo 'insert fail';
exit;
}
echo"<font color='red'
size='5'>congulations</font><br>\n";
$db->close();
}
?>
<html>
<head>
<title>regisetr form</title>
</head>
<body>
<?php
if(!empty($username)){
echo "your information is<br>\n";
echo "username:$username<br>\n";
echo "pwd:$pwd<br>\n";
echo "repeat_pwd:$repeat_pwd<br>\n";
echo "name:$name<br>\n";
echo "email:$email<br>\n";
}
?>
<form name="frmRegister" method="post"
action="register.php">
<table width="330" border="0" align="center"
cellpadding="5" bgcolor="#eeeeee">
<tr>
<td width="40%">username</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td>password</td>
<td><input name="pwd" type="password" id="pwd"></td>
</tr>
<tr>
<td>repeat password</td>
<td><input name="repeat_pwd" type="password"
id="repeat_pwd"></td>
</tr>
<tr>
<td>name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>email</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="submit">
<input type="reset" name="reset" value="reset"></td>
</tr>
</table>
</form>
</body>
</html>

New Topic/Question
Reply




MultiQuote



|