im new to php, i just want to echo firstname can anyone please help me !
When i click on the submit button it redirects to action.php and then i want to echo my firstname from the form from previous page.
Here is my code :
action.php
<?php
echo "Great! Thanks" . $s1 . " for responding to our survey" ;
?>
index.php
<head>
<title>Idiot Box Survey</title>
<meta charset="utf-8">
</head>
<body>
<form action="action.php" method="post">
<label>Firstname : </label>
<input type="text" name="fname"><br><br>
<label>Lastname : </label>
<input type="text" name="lname"><br><br>
<label>Year of birth : </label>
<input type="date" name="ybirth"><br><br>
<label>Year at School : </label>
<input type="date" name="yschool"><br><br>
<label>When will You Wake up : </label>
<input type="time" name="wake"><br><br>
<label>How much time you spend on studying : </label>
<input type="time" name="study"><br><br>
<label>How much time you spend on Video games : </label>
<input type="time" name="vgames"><br><br>
<label>How much time you spend on tv : </label>
<input type="time" name="tv"><br><br>
<label>How much time you spend with family : </label>
<input type="time" name="family"><br><br>
<label>How much time you spend with friends : </label>
<input type="time" name="friends"><br><br>
<label>When will You Sleep : </label>
<input type="number" name="sleep"><br><br>
<button type="submit" name="submit"> Submit Form </button>
</form>
</body>
action.php?