PHP program to accept user details such as user-id, name, Address, email, and mobile no. Display same information on next page.||EasyCoding45

 In This Tutorial, we are going to learn how we can write a PHP program to accept user details such as user-id, name, Address, email, and mobile no. and also  Displaying the  same information on next page.


Program 1(HTML) ::--(To Accept the Data From User)


<html>

<head>

<title>User Information</title>

<center><h3>USER INFORMATION</h3>

<table border=1>

<form method=post action="A2.php">

<tr><th>Enter User-ID :</th><td><input type=text name=t1></td>

<tr><th>Enter User Name :</th><td><input type=text name=t2></td></br>

<tr><th>Enter User Address :</th><td><input type=text name=t3></td></br>

<tr><th>Enter User Email :</th><td><input type=text name=t4></td></br>

<tr><th>Enter Mobile no :</th><td><input type=text name=t5></br></td>

</table><br>

<input type=submit value=submit>

</form>

</center>

</head>

</html>

Output 1(HTML) ::--




Program 2(PHP)::--

<?php

$id=$_POST['t1'];
$name=$_POST['t2'];
$add=$_POST['t3'];
$email=$_POST['t4'];
$mobile=$_POST['t5'];

echo"<center><h3>User Information on Next Page </h3><table border=1>
<tr>
<th>User ID</th>
<td>$id</td>
</tr>";
echo "<tr>
<th>User Name</th>
<td>$name</td>
</tr>";
echo "<tr>
<th>User Address</th>
<td>$add</td>
</tr>";
echo "<tr>
<th>User Email</th>
<td>$email</td>
</tr>";
echo "<tr>
<th>User Mobile no</th>
<td>$mobile</td>
</tr>";
?>



Final Output ::--


                                Thank You💚                                    

Comments