simon66
Jun 14th, 2010, 02:32 PM
Hi im trying to make a website and I want people to register to my site. So I made a registration form (in php duh) and the design is good, but now is the coding part.
<div id="reg">
<p>
In order to be able to gain access to the UFC stream, you must first register. Please
enter your desired user name, your email address and other required details in the
form below.</p>
<form action="" method="post">
<p>
<strong>User Name:</strong><br />
<input name="user" type="text" size="50" />
</p>
<fieldset style="width: 100%;">
<legend>Password</legend>
<table style="text-align: left;" cellpadding="0">
<tr>
<td colspan="2">
Please enter a password for your user account. Note that passwords are case-sensitive.
</td>
</tr>
<tr>
<td width="186">
Password:
</td>
<td width="319">
Confirm Password:
</td>
</tr>
<tr>
<td>
<input name="pass" type="password" size="30" />
</td>
<td>
<input name="pass_again" type="password" size="30" />
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset style="width: 100%;">
<legend>Email Address</legend>
<table style="text-align: left;" cellpadding="0">
<tr>
<td colspan="2">
Please enter a valid email address for yourself.
</td>
</tr>
<tr>
<td width="186">
Email Address::
</td>
<td width="319">
Confirm Email Address:
</td>
</tr>
<tr>
<td>
<input name="email" type="text" size="30" id="email" />
</td>
<td>
<input name="email_again" type="text" size="30" id="email_again" />
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset style="width: 100%;">
<legend>Captcha Verification</legend>
<?
require_once('captcha/recaptchalib.php');
$publickey = "6Lev0roSAAAAAPmNWWtRTbeLzmCHMuIQz7Ly4Wop "; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
</fieldset>
<br />
<center>
<input type="submit" value="Complete Registration" class="button"/>
<input type="reset" value="Reset Fields" name="Reset" class="button" />
</center>
</form>
</div>
thats the login area, you can take a look at it live here
http://www.smartinuzzi.com/register.php
Right now there is no validation and I want to add some basic validation.
How can I validate if the password and password_conf is the same?
I don't want a page to open, I need a popup saying "password must be the same" like the javascript ALERT fundtion.
<div id="reg">
<p>
In order to be able to gain access to the UFC stream, you must first register. Please
enter your desired user name, your email address and other required details in the
form below.</p>
<form action="" method="post">
<p>
<strong>User Name:</strong><br />
<input name="user" type="text" size="50" />
</p>
<fieldset style="width: 100%;">
<legend>Password</legend>
<table style="text-align: left;" cellpadding="0">
<tr>
<td colspan="2">
Please enter a password for your user account. Note that passwords are case-sensitive.
</td>
</tr>
<tr>
<td width="186">
Password:
</td>
<td width="319">
Confirm Password:
</td>
</tr>
<tr>
<td>
<input name="pass" type="password" size="30" />
</td>
<td>
<input name="pass_again" type="password" size="30" />
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset style="width: 100%;">
<legend>Email Address</legend>
<table style="text-align: left;" cellpadding="0">
<tr>
<td colspan="2">
Please enter a valid email address for yourself.
</td>
</tr>
<tr>
<td width="186">
Email Address::
</td>
<td width="319">
Confirm Email Address:
</td>
</tr>
<tr>
<td>
<input name="email" type="text" size="30" id="email" />
</td>
<td>
<input name="email_again" type="text" size="30" id="email_again" />
</td>
</tr>
</table>
</fieldset>
<br />
<fieldset style="width: 100%;">
<legend>Captcha Verification</legend>
<?
require_once('captcha/recaptchalib.php');
$publickey = "6Lev0roSAAAAAPmNWWtRTbeLzmCHMuIQz7Ly4Wop "; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
</fieldset>
<br />
<center>
<input type="submit" value="Complete Registration" class="button"/>
<input type="reset" value="Reset Fields" name="Reset" class="button" />
</center>
</form>
</div>
thats the login area, you can take a look at it live here
http://www.smartinuzzi.com/register.php
Right now there is no validation and I want to add some basic validation.
How can I validate if the password and password_conf is the same?
I don't want a page to open, I need a popup saying "password must be the same" like the javascript ALERT fundtion.