User Tools

Site Tools


programmieren:html:forms

This is an old revision of the document!


HTML Forms

1st Iteration

HTML forms done like dis in a PHP app for example:

<form action="form.php" method="post" id="message">
    Name: <input type="text" name="name"><br>
    E-mail: <input type="email" name="email"><br>
    <input type="submit">
</form>
 
<textarea name="message" form="message">Write message here...</textarea>

This leads to the textarea being below the submit button but still being part of the form since you can't put textareas as a form input.

Reading data from Form

Form needs to do a Post then the data can be read from the post like so:

<?= 'Name: ' . $_POST["name"] ?>
<br>
<?= 'Email: ' . $_POST["email"] ?>
<br>
<?= 'Phone: ' . $_POST["phone"] ?>
<br>
<?= 'Birthday: ' . $_POST["birthday"] ?>
<br>
<?= 'Message: ' . $_POST["message"] ?>
programmieren/html/forms.1786519769.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki