User Tools

Site Tools


Creating a basic HTML form

<form method='post' action=''>
<input type='text' name='search_keyword'>
<input type='submit' name='search_button' value='Search'>

Adding some PHP code to dump the form conents

echo "<pre>";
echo "</pre>";

Full working example

  <form method='post' action=''>
    <input type='text' name='forename'>
    <input type='submit' name='say_hello' value='Say hello'>

   if(!empty($_REQUEST['forename'])) {
     echo "Hello {$_REQUEST['forename']}";

Note: We'll start with this, then explain how to make it not as full-of-errors :)

basic_form.1561458556.txt.gz · Last modified: 2019/06/25 10:29 by nmckillop