How to transfer/store HTML element data into Php variables

<!doctype html>
 <?php
   
     /* ------------------------------HTML TO PHP TRANSFER CODE-----------------------------*/
        
        $TxtSlno1=$_REQUEST['TxtSlno'];
        // or $TxtSlno1=$_GET['TxtSlno'];
        // or $TxtSlno1=$_POST['TxtSlno'];
	echo $TxtSlno1;

	$TxtSname1=$_REQUEST['TxtSname'];
	echo $TxtSname1;

	$TxaAddr1=$_REQUEST['TxaAddr'];
	echo $TxaAddr1;

	$Rdbsex1=$_REQUEST['Rdbsex'];
	echo $Rdbsex1;

	$TxtUname1=$_REQUEST['TxtUname'];
	echo $TxtUname1;

	$TxtPassword1=$_REQUEST['TxtPassword'];
	echo $TxtPassword1;

	$DtpDob1=$_REQUEST['DtpDob'];
	echo $DtpDob1;

	$TxtMobno1=$_REQUEST['TxtMobno'];
	echo $TxtMobno1;

	$TxtEmail1=$_REQUEST['TxtEmail'];
	echo $TxtEmail1;

	$CmbSecQues1=$_REQUEST['CmbSecQues'];
	echo $CmbSecQues1;

	$TxtSecAns1=$_REQUEST['TxtSecAns'];
	echo $TxtSecAns1;

	$ChkCricket1=$_REQUEST['ChkCricket'];
	echo $ChkCricket1;

	$TChkDance1=$_REQUEST['ChkDance'];
	echo $TChkDance1;

	$ChkMusic1=$_REQUEST['ChkMusic'];
	echo $ChkMusic1;

	$TxtRem1=$_REQUEST['TxtRem'];
	echo $TxtRem1;
 ?>    
  <!--------------------------------HTML DESIGN CODE------------------------------------->   
<html>
   <head>
      <title>Codershelpline Code for display html value</title>
   </head>
   <body>
      <form name="form1" id="form2" action="#" method="post" >
	 <center>
	    <fieldset style="width: 600px">				
		<legend>Create New Student Account</legend>
		   <table>
		      <tr>
			  <td>Serial No.</td>
			  <td>:</td>
			  <td><input type="text" name="TxtSlno"></td>
		      </tr>
		      <tr>
			  <td>Student Name</td>
			  <td>:</td>
			  <td><input type="text" name="TxtSname"></td>
		      </tr>
		      <tr>
			  <td>Address</td>
			  <td>:</td>
			  <td>
			     <textarea cols="35" rows="5" name="TxaAddr"></textarea>							
			  </td>
		       </tr>
		       <tr>
			  <td>Sex</td>
			  <td>:</td>
		          <td>
			<input type="radio" name="Rdbsex" id="RdbMale" value="Male">Male
			<input type="radio" name="Rdbsex" id="RdbFemale" value="Female">Female
			<input type="radio" name="Rdbsex" id="RdbOther" value="Other">Other
		          </td>
		       </tr>						
		       <tr>
			  <td>User Name</td>
			  <td>:</td>
			  <td><input type="text" name="TxtUname"></td>
		       </tr>
		       <tr>
			  <td>Password</td>
			  <td>:</td>
			  <td><input type="password" name="TxtPassword"></td>
		       </tr>
		       <tr>
			  <td>Confirm Password</td>
			  <td>:</td>
			  <td><input type="password" name="TxtCpassword"></td>
		       </tr>
		       <tr>
		          <td>DOB</td>
			  <td>:</td>
			  <td><input type="date" name="DtpDob"></td>
		       </tr>
		       <tr>
			  <td>Mobile No.</td>
			  <td>:</td>
			  <td><input type="Number" name="TxtMobno"></td>
		       </tr>
		       <tr>
			  <td>Email</td>
			  <td>:</td>
			  <td><input type="text" name="TxtEmail"></td>
		       </tr>					
		       <tr>
			  <td>Security Questions</td>
			  <td>:</td>
			  <td>
   <select name="CmbSecQues">
       <option value="Choose One">Choose One</option>
       <option value="What is Your Favourite Book">What is Your Favourite Book</option>
       <option value="What is Your Favourite Teacher">What is Your Favourite Teacher</option>
       <option value="What is Your Favourate Place">What is Your Favourate Place</option> 
       <option value="What is Your Favourate Pets">What is Your Favourate Pets</option>
   </select>
			 </td>
		     </tr>
		     <tr>
			<td>Security Answer</td>
			<td>:</td>
			<td><input type="text" name="TxtSecAns"></td>
		     </tr>
		     <tr>
			<td>Hobbies</td>
			<td>:</td>
			<td>
			   <input type="checkbox" name="ChkCricket" value="Cricket">Cricket
			   <input type="checkbox" name="ChkDance" value="Dance">Dance
			   <input type="checkbox" name="ChkMusic" value="Music">Music			   
			</td>
		     </tr>
		     <tr>
			<td>Remarks</td>
			<td>:</td>
			<td><input type="text" name="TxtRem" value="N/A"></td>
		     </tr>
		     <tr>
			<td></td>
			<td></td>
			<td><input type="submit" name="BtnSave" value="Save">
			     <input type="reset" name="BtnReset" value="Reset">
			</td>
		     </tr>

		  </table>
	       </fieldset>
             </center>
	  </form>
        </body>
     </html>

Loading

Categories:

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.