1 / 7

Formularerstellung und Formularauswertung in PHP

Formularerstellung und Formularauswertung in PHP. von Franka – Maria Volk 12a. Inhaltverzeichnis. 1. kurze Einführung 2. JavaScript und Formularvalidierung 3. Erstellen einer Formularseite 3.1. Beispiel mit Quelltexterläuterung 3.2. Attribut “action”

tiva
Download Presentation

Formularerstellung und Formularauswertung in PHP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Formularerstellung undFormularauswertung in PHP von Franka – Maria Volk 12a

  2. Inhaltverzeichnis • 1. kurze Einführung • 2. JavaScript und Formularvalidierung • 3. Erstellen einer Formularseite • 3.1. Beispiel mit Quelltexterläuterung • 3.2. Attribut “action” • 3.3. Attribut “method” (post und get) • 4. Quellenangabe

  3. 1. kurze Einleitung • ein Formular ist eine Art Online Fragebogen • in bestimmten Eingabefeldern kann der Besucher Kommentare hinterlassen, die vom Webseitenbesitzer ausgewertet werden • => Kontaktaufnahme zum Kunden • Gewinn –und Quizspiele werden ausgeführt

  4. 2. JavaScript und Formularvalidierung • JavaScript eignet sich hervorragend um Formulare zu validieren (überprüfen) • => Bsp. überprüft ob die eingegebene E-Mail-Adresse des Kunden gültig ist, ob die Postleitzahl 5 Stellen hat etc. …….. • PHP kann das auch aber : • => PHP läuft auf dem Server und belastet den Rechner des Anbieters • => bestimmte Serverkapazität • => hoher Kundenansturm • => Überlastung des Servers • => JavaScript wird über den Browser ausgeführt (d.h. vom Client) • => die eine kleine Validierung belastet den Server kaum • Reihenfolge: • HTML - Eingabemaske => für Formularauswertung nicht gedacht • JavaScript - Formularvalidierung • PHP (Validierung möglich) - Auswertung

  5. 3.1. Beispiel mit Quelltexterläuterung <html> <head> <title>HTML-Formular</title> </head> <body bgcolor="yellow"> <h1>Eingabemaske</h1> <form action="auswertung.php“ method="post" Ihr Vorname: <input type="text" name="Vorname"/> <input type="submit" /> </form> </body> </html> 3.2. Attribut “ action” HTML-Syntax nach Klicken auf den Button wird Attribut aktiv der Formularinhalt wird an die Seite auswertung.php geschickt (die später noch erstellt wird) 3.3. Attribut “method” (get und post) “method” ist für die Methode des Verschickens verantwortlich method =“get” Daten werden an URL angehängt methode = “post” Formularinhalt wird unsichtbar und unverschlüsselt an das Dokument übergegen name- Werte stehen automatisch im Array $_post zur Verfügung Name des Formularsfeldes wird automatisch zum Key Beispiel : $_Post [Vorname] die als value (Wert) den String “Hans” beinhaltet 3. Erstellen der Formularseite

  6. „auswertung.php“ • zweites HTML Dokument wird angelegt “ auswertung.php” • in diesem wird auf den eingegebenen Namen zurückgegriffen • <html> • <head> • <title>HTML- Dokument</title> • </head> • <body> • <? • echo "Hallo <b>$_POST[Vorname]</b>, herzlich willkommen!"; • ?> • </body> • </html>

  7. 4. Quellenangabe • Johann-Christian Hanke(2005):“PHP 5 leicht und verständlich“: knowware Verlag: S.30-32 • www.php-homepage.de/manual

More Related