Friday, January 10, 2014

Registration form code

<?php
    include "settings.php";
?>
<html>
<head>
<title> REgistration Form</title>
</head>

<body>
    <form name="information" action="user.php" method="post">

    <table width="274" border="0" align="center" cellpadding="2" cellspacing="0">
    <tr>
    <td colspan="2">
    <div align="center">

        <h1 align="center"> Registration Form</h1>

    </div></td>
    </tr>
    <tr>
    <td width="95"><div align="right">Name:</div></td>
    <td width="171"><input type="text" name="name" /></td>
    </tr>
    <tr>
    <td><div align="right">F.Name:</div></td>
    <td><input type="text" name="fname" /></td>
    </tr>
    <tr>
    <td><div align="right">Email:</div></td>
    <td><input type="text" name="email" /></td>
    </tr>
    <tr>
    <td><div align="right">Date of Birth:</div></td>
    <td><input type="text" name="dob" /></td>
    </tr>
    <tr>
    <td><div align="right">Current Class.:</div></td>
    <td><input type="text" name="currentclass" /></td>
    </tr>
    <tr>
    <td><div align="right">Obtained Marks:</div></td>
    <td><input type="text" name="obmarks" /></td>
    </tr>
    <tr>
    <td><div align="right">Percentage:</div></td>
    <td><input type="text" name="percentage" /></td>
    </tr>
    <tr>
    <td><div align="right">Field Of Study:</div></td>
    <td><input type="text" name="fieldofstudy" /></td>
    </tr>
    <tr>
    <td><div align="right"></div></td>
    <td><input name="submit" type="submit" value="Submit" /></td>
    </tr>


     <?php
                    if(isset($_POST['Registration']))
                    {

                        $name = $_POST['name'];
                        $fname = $_POST['fname'];
                        $email = $_POST['email'];
                        $dob = $_POST['dob'];
                        $currentclass = $_POST['currentclass'];
                        $obmarks = $_POST['obmarks'];
                        $percentage = $_POST['percentage'];
                        $fieldofstudy = $_POST['fieldofstudy'];
               

                        if(!$name || !$fname || !$email || !$dob || !$currentclass || !$obmarks || !$percentage || !$fieldofstudy )
                            echo "Please enter all the values to sign up";
                        else
                        {
                            $sql = "INSERT INTO information VALUES ('', '$name','$fname','$email' , '$dob','$currentclass','$obmarks' , '$percentage','$fieldofstudy')";
                            $query = mysql_query($sql);
                            if($query)
                                echo "Registered successfully";
                            else
                                echo "Failed. There was an error while registering you.";
                        }
                    }

    </table>
    </form>





</body>
<html>

Click on Download below to get the file///////////


Related Posts:

  • Hangman game code in Visual c#using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace hangman_csharp {     static class Program     {         /// <summary> &nb… Read More
  • PHP Code for Inserting Data<html> <head> <style type="text/css">     ul {     list-style: none;     margin: 0;     }     li {     float: left;     }     … Read More
  • HTML code to Design front Page of any hotel<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>KHYBERS G… Read More
  • LOGIN Form Login form with css and Database connectivity and sql file Free download the zip folder  :click to download … Read More
  • Simplest jQuery Slideshow Code Simplest jQuery Slideshow Code <html "> <head> <title>Simplest jQuery Slideshow</title> <style> body {font-family:Arial, Helvetica, sans-serif; font-size:12px;} .fadein {  posit… Read More

0 comments:

Post a Comment