Differences
This shows you the differences between two versions of the page.
amprog_05_ex2 [2017-06-08 09:31] Daniel Viström |
amprog_05_ex2 [2022-07-18 13:20] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Tips till uppgift 8 ($_SESSION) ====== | ||
- | <code php> | ||
- | <?php | ||
- | include(' | ||
- | |||
- | session_name(' | ||
- | session_start(); | ||
- | // | ||
- | // | ||
- | \\Sessionvariablerna finns kvar tills webbläsaren stängs, eller tills man " | ||
- | |||
- | |||
- | if(!isset($_SESSION[' | ||
- | $_SESSION[' | ||
- | } | ||
- | |||
- | |||
- | if(isset($_POST[' | ||
- | $_SESSION[' | ||
- | } | ||
- | |||
- | $i=0; | ||
- | while ($i < count($_SESSION[' | ||
- | echo $_SESSION[' | ||
- | $i++; | ||
- | } | ||
- | ?> | ||
- | |||
- | <form method=" | ||
- | Skriv nåt: <input type=" | ||
- | <input type=" | ||
- | </ | ||
- | |||
- | <?php | ||
- | include(' | ||
- | ?> | ||
- | </ |