Search....

Friday 16 November 2018

simple form in html using php | Class Assignment

<?php
if (isset ($_POST["submit"])){
  $name = $_POST["name"];
  $fatherName = $_POST["fname"];
  $Dob = $_POST["date"];
  $eml = $_POST["email"];

  echo "name is: $name, <br>".
  " Father name is: $fatherName, <br>".
  "Date of birth is: $Dob <br>".
  "Email is: $eml";
}
 ?>



<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Email function</title>
  </head>
  <body>
    <form class="" action="" method="post">
      <label for="">Name:</label>
      <br>
      <input type="text" name="name" value="" placeholder="Enter your name">
      <br>
      <label for="">Father Name:</label>
      <br>
      <input type="text" name="fname" value="" placeholder="Enter your Fathe Name">
      <br>
      <label for="">Date of birth:</label>
      <br>
      <input type="date" name="date" value="">
      <br>
      <label for="">Email:</label>
      <br>
      <input type="email" name="email" value="" placeholder="Enter your email">
      <br>
      <br>
      <br>
      <input type="submit" name="submit" value="submit">
    </form>
  </body>
</html>



Copy this whole code from here and paste it in your editor (Notepad ++, sublime text, Atom, Bracket etc), and save this file as "abc.php" and keep that file inside your htdocs directory, Now run it and accept data from user and displayed it on the top. 

No comments:

Post a Comment

Semester project - E commerce site - with source code

Here is the link to get soure code for semester project of ecommerce site. Click me to download