Jump to content

How to put Form information into a html table


MjM8082

Recommended Posts

Have never done this before, but I'm sure many of you have. What I am trying to do is take the information that the user fills out in this form and when they hit submit, it will be displayed into a html table on the next page. I don't need someone to do the entire table for me, just looking for some help to get started and a general idea of what to do.

 

 

Here is my code for my form that I have created...

 

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
    <title>Lab 4</title>
    
</head>


<body>
    <?php



?>



<form method="POST" action="lab4form.php">		

<label for="first_name">First Name:</label>
<input type="text" id="first_name" name="first_name" /><br />		
<label for="last_name">Last Name:</label>
<input type="text" id="last_name" name="last_name" /><br />	
<label for="coverage_amount">Coverage Amount:</label> 
<input type="text" id="coverage_amount" name="coverage_amount" /><br />	
<label for="gender">Gender:</label>
<br>
<input id="male" type="radio" value="radiobutton" name="male" />
	<label for="male">Male</label> 

<input id="female" type="radio" value="radiobutton" name="female" />
	<label for="female">Female</label> <br />
	<br>
<label for="Age">Age:</label>
<input type="text" id="age" name="age" /><br />	
<br>
<label for="health">Health Conditions</label> <br />

<input type="checkbox" name="health" value="heart" />
<label for="health">Heart Disease</label><br />

<input type="checkbox" name="health" value="diabetes" />
<label for="health">Diabetes</label><br />

<input type="checkbox" name="health" value="blood" />
<label for="health">High Blood Pressure</label><br />

<input type="checkbox" name="health" value="Smoker" />
<label for="health">Smoker</label><br />

<input type="checkbox" name="health" value="lung" />
<label for="health">Lung disease</label><br />

<FORM METHOD=POST ACTION="lab4form.php">
<P>Employment Status<BR>
<SELECT NAME="employment">
<OPTION VALUE="lab4form.php">Unemployed
<OPTION VALUE="lab4form.php">Full-Time
<OPTION VALUE="lab4form.php">Part-Time
<OPTION VALUE="lab4form.php">Student
</SELECT><br />
<br>
<label for="comments">Comments</label>
<input type="text" id="comments" name="comments"/><br />






<br>
<input type="submit" value="Add User" name="btn_add" />			
</form> 
</body>
</html>

 

 

 

 

 

 

 

Thank you,

 

and when I get to something like.. The check boxes and radio buttons on the form, how do I get those to display on the table?

 

For example... Gender on the form is selected by a radio button. How would I get the correct radio button that is click on to display on the next page on the table?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.