
February 8th, 2013, 01:06 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 3
Time spent in forums: 15 m 56 sec
Reputation Power: 0
|
|
|
PHP5 - Help with form
How come my php function wont respond when i press submit button in form??
<?php
include 'connect.php';
?>
<title>Registration</title>
<form method='post'>
<?php
if(isset($_POST['register_button'])){
$username = $_POST['username'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$password = $_POST['password'];
$confirm_password = $_POST['confirm_password'];
if(empty($username) or empty($first_name)){
echo'fields missing!';
} else if ($password != $confirm_password) {
echo"confirm password didnt match";
} else {
mysql_query("INSERT INTO members VALUES('', '$first_name', '$last_name', '$username', '$email', '$password')");
echo "Successfully Registered";
}
}
?>
Name: <br/>
<input type='text' name='first_name' />
<input type='text' name='last_name' />
<br /><br />
User Name : <br />
<input type='text' name='username' />
<br /><br/>
email ID : <br/>
<input type='email' name='email' />
<br/><br/>
Password :
</form><br>
<input type='password' name='password' />
<br/><br/>
Confirm Password:
<br/>
<input type='password' name='confirm_password' />
<br/><br/>
<input type='submit' value='submit' id='button' name='register_button' />
</form>
Reply With Quote Reply With Quote
|