Total members 10262 | Gratitudes |It is currently Thu May 24, 2012 5:05 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 3 posts ] 
Author Article
 Article subject: php User Registration Form
PostPosted: Sun Oct 26, 2008 11:17 pm 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time

Code:

<html>
  <head>
  <title>Index</title>
  </head>
  <body>
  <h2 align="center">User Registration Form</h2>
  <form name="forml" method="post" action="UserRegistrationFormOutput.php" enctype="multipart/form-data">
    <table width="53%" border="0" align="center" cellpadding="5" cellspacing="0">
      <tr>
        <td width="49%">Name</td>
        <td colspan="2">
          <div align="left"
           <input type="text" name="name" size="25" maxlength="25">
         </div>
        </td>
      </tr>
      <tr>
        <td width="49%">&nbsp;</td>
        <td height="2" colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td width="49%" height="57">Address</td>
        <td height="57" colspan="2">
          <textarea name="address" cols="25" rows="4">  </textarea>
        </td>
      </tr>
      <tr>
        <td width="49%">&nbsp;</td>
        <td height="2" colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td width="49%"> Date of Birth</td>
        <td height="2" colspan="2">
          <select name=birth_month>
            <option selected value=1>January
            <option value=2> February
            <option value=3>March
            <option value=4>April
            <option value=5>May
            <option value=6>June
            <option value=7>July
            <option value=8>August
            <option value=9>September
            <option value=10>October
            <option value=11>November
            <option value=12>December
      </select>
      <select name=birth_day>
            <option selected value=1>01
            <option value=2>02
            <option value=3>03
            <option value=4>04
            <option value=5>05
            <option value=6>06
            <option value=7>07
            <option value=8>08
            <option value=9>09
            <option value=10>10
            <option value=11>11
            <option value=12>12
            <option value=13>13
            <option value=14>14
            <option value=15>15
            <option value=16>16
            <option value=17>17
            <option value=18>18
            <option value=19>19
            <option value=20>20
            <option value=21>21
            <option value=22>22
            <option value=23>23
            <option value=24>24
            <option value=25>25
            <option value=26>26
            <option value=27>27
            <option value=28>28
            <option value=29>29
            <option value=30>30
            <option value=31>31</option>
          </select>
          <input maxlength=4 name=birth_year size=4>
             (Year)</td>
      </tr>
      <tr>
        <td width="49%" height="2">&nbsp;</td>
        <td height="2" width="17%">&nbsp;</td>
        <td height="2" width="34%">&nbsp;</td>
      </tr>
      <tr>
        <td width="49%">Gender</td>
        <td height="2" width="17%"><input type="radio" name="gender" value="M">Male </td>
        <td height="2" width="34%"><input type="radio" name="gender" value="F">Female </td>
      </tr>
      <tr>
        <td width="49%" height="5">&nbsp;</td>
        <td height="5" colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td width="49%">Music Preference </td>
        <td height="2" colspan="2">
          <table width="100%" border="0">
            <tr>
              <td>
                <input type="checkbox" name="pop" value="1">
                   Pop </td>
              <td>
                <input type="checkbox" name="rock" value="1">
                   Rock </td>
            </tr>
            <tr>
              <td>
                <input type="checkbox" name="jazz" value="1">
                   Jazz </td>
              <td>
                <input type="checkbox" name="metal" value="1">
                   Metal </td>
            </tr>
            <tr>
              <td>
                <input type="checkbox" name="instrumental" value="1">
                   Instrumental </td>
              <td>&nbsp;</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td width="49%" height="2">&nbsp;</td>
        <td colspan="2" height="2">&nbsp;</td>
      </tr>

      <tr>
        <td colspan="3">
          <div align="center">
            <input type="submit" name="Submit" value="Submit">
          </div>
        </td>
      </tr>
    </table>
  </form>
  </body>
  </html>
  
  
<!--   UserRegistrationFormOutput.php
  
<html>
  <head>
  <title>Display Output </title>
  </head>
  <body>
  <h2> Dear
  <?php
     
if ($gender=='M') {
       echo
"Mr.";
     } elseif (
$gender=='F') {
       echo
"Ms.";
     }
     echo
" ", $name;
     
?> ! You have entered the following information: </h2>
     <table border="1">
       <tr>
         <td>Address </td>
         <td>
           <?php echo $address; ?>
         </td>
       </tr>
       <tr>
         <td>Date of Birth </td>
         <td>
           <?php echo $birth_month, " ", $birth_day, " ", $birth_year; ?>
         </td>
       </tr>
       <tr>
         <td colspan=2>You prefer listening to:
  <?php
  
if (!(empty($pop))) {
      if (
$pop==1){
         echo
" Pop ";      
      }
  }
  if (!(empty(
$jazz))) {
     if (
$jazz==1) {
         echo
" Jazz ";      
     }
  }
  if (!(empty(
$rock))) {
     if (
$rock==1){
         echo
" Rock ";      
     }
  }
  if (!(empty(
$instrumental))) {
     if (
$instrumental==1) {
         echo
" Instrumental ";
     }
  }
  if (!(empty(
$metal))) {
     if (
$metal==1){
         echo
" Metal ";     
     }
  }
?>
</td>
</tr>

  </table>
  </body>
  </html>

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
 Article subject: Re: php User Registration Form
PostPosted: Thu Oct 20, 2011 6:36 am 
This part is missing in the UserRegistrationFormOutput.php file

$name = $_POST['name'];
$address = $_POST['address'];
$birth_month= $_POST['birth_month'];
$birth_day = $_POST['birth_day'];
$birth_year = $_POST['birth_year'];
$gender = $_POST['gender'];
$pop = $_POST['pop'];
$jazz = $_POST['jazz'];
$rock = $_POST['rock'];
$metal = $_POST['metal'];
$instrumental = $_POST['instrumental'];


TOP
  
Reply with quote  
 Article subject: Re: php User Registration Form
PostPosted: Thu Oct 27, 2011 12:01 am 
Offline
Mastermind
User avatar

Joined: Tue Mar 27, 2007 10:55 pm
Posts: 2279
Location: Earth
Has thanked: 39 time
Have thanks: 61 time
Thanks for your modification .

_________________
Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 3 posts ] 
Quick reply


  

 Similar topics
 getting gst, pst total to diplay in my javascript form
 [Ajax/PHP] Registration - Check for empty textboxs
 How to make PHP form data saved into txt file
 complete registration form with validation
 php login form (sign-in form)
 Selecting a Domain Name at the Time of Registration
 Registration page in jsp
 i want to send conformation email with user details on the
 convert image (vehicle registration) to text in java?
 redirect page based on user selection radio button

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 2 guests



Jump to:  
Previous Article | Next Article 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team