Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
lab4_code [2015-09-10 08:49] 127.0.0.1 external edit |
lab4_code [2016-11-30 22:38] Joakim Forsgren |
||
---|---|---|---|
Line 13: | Line 13: | ||
highlight_file(' | highlight_file(' | ||
</ | </ | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | include_once ' | ||
+ | |||
+ | // Om man har prövat att logga in. | ||
+ | if (!empty($_POST[' | ||
+ | // Kollar EMail och Password, bör bara finnas en... | ||
+ | $query = " | ||
+ | $result = mysqli_query($link, | ||
+ | if (mysqli_num_rows($result) != 1) { | ||
+ | header(' | ||
+ | exit(); | ||
+ | } | ||
+ | // Nu har vi en OK inloggning! | ||
+ | // Sätter alla session variabler och går till sidan start.php. | ||
+ | $row = mysqli_fetch_assoc($result); | ||
+ | $_SESSION[' | ||
+ | $_SESSION[' | ||
+ | $_SESSION[' | ||
+ | header(' | ||
+ | exit(); | ||
+ | } | ||
+ | |||
+ | </ | ||