1Webpage to a Database_did_mat1_1 variant

  • docx
  • 09.05.2020
Публикация на сайте для учителей

Публикация педагогических разработок

Бесплатное участие. Свидетельство автора сразу.
Мгновенные 10 документов в портфолио.

Иконка файла материала 1Webpage to a Database_did_mat1_1 variant.docx

Didactical material

Name __________________ Class ______________________

Objective: 10.3.3.3 link a webpage to a database

Create a simple HTML form and accept the user name and display the name through PHP echo statement.

sample html form

Solution

<!DOCTYPE html>

<html>

<head>

   <title></title>

   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

   </head>

   <body>

   <form method='POST'>

   <h2>Please input your name:</h2>

 <input type="text" name="name">

 <input type="submit" value="Submit Name">

 </form>

<?php

//Retrieve name from query string and store to a local variable

$name = $_POST['name'];

echo "<h3> Hello $name </h3>";

?>

</body>

</html>