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 Both sides next revision
dvprog15 [2020-05-18 20:25]
Daniel Viström
dvprog15 [2020-12-18 10:10]
Daniel Viström
Line 85: Line 85:
    
 include 'foot.php'; include 'foot.php';
 +</code>
 +
 +Alternativt kan man hantera formuläret så här:
 +<code php>
 +include('head.php');
 +
 +echo $message;
 +?>
 +
 +<form method="post">
 +   <input type="text" placeholder="Namn" name="namn"><br>
 +   <input type="hidden" name="namn2" value="<?php echo $_POST['namn'] ?>">
 +   <input type="submit" name="submit" value="skicka">
 +</form>
 +
 +<?php
 +include('foot.php');
 </code> </code>
  
 Kolla upp [[http://www.php.net/manual/en/ref.strings.php|strängfunktionerna]] för att hantera html-taggar i saker som matas in i formulär. Kolla upp [[http://www.php.net/manual/en/ref.strings.php|strängfunktionerna]] för att hantera html-taggar i saker som matas in i formulär.