PHP Registration Form-Part1


Hi guys,

Here we go with some simple registration form with php and a littlebit of javascript validation.Here in the below example we have the following fields

Firstname,lastname,Email,Password,CityName

STEP 1

The first step is to open a editor on your wish i just choose here the Dreamweaver cs4 so the php content goes between this delimiters

<?php

Php Code

?>

So the above all fields required textbox only first of all open the Html page and save it as register.html in that fill with the below codes in the body section

<form name=”form1″ method=”post” action=”update.php” onsubmit=”return checkform(form1);”>
<div>
<table cellspacing=”5″ cellpadding=”3″ width=”400″>
<tr>
<td> First Name</td>
<td><input type=”text” name=”fname”/></td>
</tr>
<div id=”first”></div>
<tr>
<td> Last Name</td>
<td><input type=”text” name=”lname” /></td>
</tr>
<tr>
<td> EMAIL</td>
<td><input type=”text” name=”email” /></td>
<div id=”email”></div>
</tr>
<tr>
<td>Password</td>
<td><input type=”password” name=”password”  /></td>
</tr>
<tr>
<td> city</td>
<td><input type=”text” name=”city” maxlength=”11″ size=”20″  /></td>
</tr>
<tr>
<td></td>
<td><input type=”Submit” name=”Submit” value=”Submit” /></td>
</tr>
</table>
</div>
</form>

some people familiar with Html codes but many people not. so what i did in the above code is that the sample layout for the registration page

In the form tag i used attributes like name,action and method. Name represents the form name that must be needed. It should be used for the validation process, next one is action that also be needed because its some thing like to redirect register page  to another page, final one is method which sould be used to pass the values of the page along with the address or not only two methods GET and POST are available. GET passes the value in address bar while POST Method not.

 Here i’m uses the Table Struture to display the form in a neatly aligned Manner syntax for table

<table> <tr><td> </td></tr> </table> 

To get the text fields in HTML Input Tag is used. syntax:<input type=” ” name=” “/>

Type is used to select it is the textbox field, Name Its  just a name for the text box so we can use that name to pass the value of the text box. type=password  means it should display the characters in special char. type =submit represents the button submit and the value represents the name that displayed in the button. I will explain the validation thing and database creation and insert the values in the database table in the next part…..please ask any doubts regarding the above page creation.

Advertisements
About

Working For Cause Not For Applause

Tagged with: , , , , , ,
Posted in PHP, web

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: