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>

 

 

 

 

 

 

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.