User Tools

Site Tools


en:web_development:forms:inputs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:web_development:forms:inputs [2022/01/23 09:51]
mag [Database Query]
en:web_development:forms:inputs [2023/08/16 09:33] (current)
Line 41: Line 41:
   * The <html><form></html> tag has a parameter called <html>action</html>. This is where you want to send your data.   * The <html><form></html> tag has a parameter called <html>action</html>. This is where you want to send your data.
   * Set <html>action</html> to 'process_form.php'.   * Set <html>action</html> to 'process_form.php'.
-<code>        <form action="process_form.php"></code>+<code>        <form action="process_form.php"></form></code>
   * Move the existing paragraph inside the <html><form></html> tags.   * Move the existing paragraph inside the <html><form></html> tags.
   * Now add our hero options as 'submit' buttons.   * Now add our hero options as 'submit' buttons.
Line 51: Line 51:
   * Save and upload the file, then open the page.   * Save and upload the file, then open the page.
   * Click on your chosen hero then check the results. Do you see your hero's name?   * Click on your chosen hero then check the results. Do you see your hero's name?
-  * This is an usual way to use a Submit button, but it's valid. Let's look at other options.+  * This is an unusual way to use a Submit button, but it's valid. Let's look at other options.
  
 ==== Text Input ==== ==== Text Input ====
Line 110: Line 110:
 ==== Dropdown Boxes ==== ==== Dropdown Boxes ====
   * Our next field is the source of the hero's power. This is a type of category, where we want to control the options that can be selected.   * Our next field is the source of the hero's power. This is a type of category, where we want to control the options that can be selected.
-  * For this we use a <html><select</html> field.+  * For this we use a <html><select></html> field.
   * Copy the following code into your form.   * Copy the following code into your form.
 <code>                    <li> <code>                    <li>
Line 218: Line 218:
   * Now let's place this in our query in 'form.php'.   * Now let's place this in our query in 'form.php'.
 <code>    // get list of movies <code>    // get list of movies
-    $query = "SELECT FROM appearances GROUP BY movie";+    $query = "SELECT movie FROM appearances GROUP BY movie";
     $args  = array();     $args  = array();
     $mrslt = $pdo->prepare($query);     $mrslt = $pdo->prepare($query);
en/web_development/forms/inputs.1642960280.txt.gz ยท Last modified: 2023/08/16 09:33 (external edit)