how to create a form (html) that users can enter text on same page?

  • Thread starter Thread starter Eder L
  • Start date Start date
E

Eder L

Guest
I'm creating a site, but I'm new at this and I need to create a FORM or something else were users can go ahead and enter their name, phone and email and them to be displayed on the same page below...
 
using HTML will not give you any results. HTML is a static language! you will need some other form or storing the information for later use.

but here is some PHP

<?
//index.php
session_start();
if($_SERVER['REQUEST_METHOD'] == "POST"){
foreach($_POST as $key => $value){
$_SESSION[$key] = $value;
echo $value . "<br>";
}
}
else{
echo "<form method=\"POST\" action=\"$_SERVER['PHP_SELF']\"><input type=\"text\" name=\"name\"><input type=\"text\" name=\"phone\"><input type=\"text\" name=\"email\"><input type=\"submit\" value=\"submit\"></form>";
}
?>
 
Back
Top