Lab #4

4. Write two different PHP scripts to demonstrate passing variables through Hidden Variables


<!DOCTYPE html>
<html lang="en">

<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pass variable URL</title>
.form-input {
margin: 10px 0;

<form action="result.php" method="post">
<div class="form-input">
<input type="text" name="name" placeholder="Enter full name">

<div class="form-input">
<input type="number" name="age" min="10" placeholder="Enter age">

<div class="form-input">
<button type="submit">Submit</button>



echo "Name: ".$_POST['name'].'<br/>';
echo "Age: ".$_POST['age'].'<br/>';


index.php page

After clicking submit button and you can notice the variable on the URL. 

Happy Coding :)