How to create data entry form in php - In this article I will share about how to create a data entry form in php. The data entry form is a form that can be entered into data then the data will be processed and displayed in a different form. To better understand about how to create a data entry form in php, here I give examples of its implementation.
Program 1
File Name: input04.php
Description: The program displays the forminputan text in large quantities.Open notepad, then type the following html code into notepad.
<html>
<head><title>Form of Processing ~ Text</title></head>
<body>
<FORM ACTION="proses04.php" METHOD="POST" NAME="input">
My close friends<br>
<input type="text" name="name1"><br>
<input type="text" name="name2"><br>
<input type="text" name="name3"><br>
<input type="text" name="name4"><br>
<input type="submit" name="Input" value="Input">
</FORM>
</body>
</html>
If you have saved the php code with the name input04.php in htdocs folder.
Program 2
File Name: process04.php
Description: Input form handling program for Program 1.
Open notepad, then type the following php code.
<?php
if (isset($_POST['Input'])) {
$name1 = $_POST['name1'];
$name2 = $_POST['name2'];
$name3 = $_POST['name3'];
$name4 = $_POST['name4'];
echo "<b>Name My Near Companions :</b> <br>";
echo $name1. "<br>";
echo $name2. "<br>";
echo $name3. "<br>";
echo $name4. "<br>";
}
?>
Save the php code with the name process04.php in the htdocs folder.
Explanation of Programs 1 and 2
Line 3-6 program 2 is the process of taking values from each of the text input form found in program 1. This variable is then displayed on the screen (lines 8-11, program 2).
To see the results please open the browser then on the address bar type http://localhost/input04.php then the results will be like the following.
That's a tutorial on how to create a data entry form in php. Hopefully these tutorials can improve our ability in learning the php programming language.
Program 1
File Name: input04.php
Description: The program displays the forminputan text in large quantities.Open notepad, then type the following html code into notepad.
<html>
<head><title>Form of Processing ~ Text</title></head>
<body>
<FORM ACTION="proses04.php" METHOD="POST" NAME="input">
My close friends<br>
<input type="text" name="name1"><br>
<input type="text" name="name2"><br>
<input type="text" name="name3"><br>
<input type="text" name="name4"><br>
<input type="submit" name="Input" value="Input">
</FORM>
</body>
</html>
If you have saved the php code with the name input04.php in htdocs folder.
Program 2
File Name: process04.php
Description: Input form handling program for Program 1.
Open notepad, then type the following php code.
<?php
if (isset($_POST['Input'])) {
$name1 = $_POST['name1'];
$name2 = $_POST['name2'];
$name3 = $_POST['name3'];
$name4 = $_POST['name4'];
echo "<b>Name My Near Companions :</b> <br>";
echo $name1. "<br>";
echo $name2. "<br>";
echo $name3. "<br>";
echo $name4. "<br>";
}
?>
Save the php code with the name process04.php in the htdocs folder.
Explanation of Programs 1 and 2
Line 3-6 program 2 is the process of taking values from each of the text input form found in program 1. This variable is then displayed on the screen (lines 8-11, program 2).
To see the results please open the browser then on the address bar type http://localhost/input04.php then the results will be like the following.
![]() |
Program View |
![]() |
Program View |
That's a tutorial on how to create a data entry form in php. Hopefully these tutorials can improve our ability in learning the php programming language.
Comments
Post a Comment