Continuation of Make Form Part1...
Make file to catch data from Form at file form_biodata.php, The first write script below in your text editor and save with name process_form.php, this name must be same with action of from at file form_biodata. Let's see script below.
<html>
<head> <title>Biodata</title>
</head>
<link rel="stylesheet" type="text/css" href="cssbiodata.css"/>
<body>
<b><h2>Biodata</h2></b>
<table id="belang">
<tr>
<td>Name</td>
<td align="right">:</td>
<td> <?php echo $_POST['name']; ?></td>
</tr>
<tr>
<td>Birthday</td>
<td align="right">:</td>
<td> <?php echo $_POST['day']; ?>
<?php echo $_POST['month']; ?>
<?php echo $_POST['year']; ?>
</td>
</tr>
<tr>
<td>Gender</td>
<td align="right">:</td>
<td> <?php echo $_POST['gender']; ?></td>
</tr>
<tr>
<td>Married ?</td>
<td align="right">:</td>
<td>
<?php
if (isset($_POST['check_married'])){
echo "Married";}
else {echo "Not yet";}
?>
</td>
</tr>
<tr>
<td>Address</td>
<td align="right">:</td>
<td> <?php echo $_POST['address']; ?></td>
</tr>
</table>
</body>
</form>
</html>
Description of script above
Script below is use to call file css for style in file process_form.php. File css there is in my previous article that is Make Form Part1.
<link rel="stylesheet" type="text/css" href="cssbiodata.css"/>
Script below is use to make table and attribute id is use to call style in file css in file cssbiodata.css.
<table id="belang">
Script belo is use to catch value or data from text filed is named 'name'. variable $_POST as value placeholders of text field 'name'.
<?php echo $_POST['name']; ?>
Script below is not different with script above that is use to catch value or data from select is named 'day', 'month' and 'year'.
<?php echo $_POST['day']; ?>
<?php echo $_POST['month']; ?>
<?php echo $_POST['year']; ?>
Script below is use to catch value or data from radio button is named 'gender'.
<?php echo $_POST['gender']; ?>
Script below is use to catch value or data from check box is named 'check_merried' and script if is a condition if check box is checked then show string "Married" and else show string "Not yet". Isset is function of php is use to mark element of form has been filled or not yet filled.
<?php
if (isset($_POST['check_married'])){
echo "Married";}
else {echo "Not yet";}
?>
Script below is to catch value or data from textarea is named 'address'.
<?php echo $_POST['address']; ?>
Let's see output of script above after data from form has been sent.
Tanks for visit and read my article... See you in my next article...
Learn and learn again...
No comments:
Post a Comment