Goede avond,
Ik heb een klein probleempje met een website, als ik em lokaal test draait die prima, maar als ik em online gooi krijg ik de volgende 2 foutmeldingen:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/thefugitives/public_html/index.php:2) in /home/thefugitives/public_html/index.php on line 3
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/thefugitives/public_html/index.php:2) in /home/thefugitives/public_html/index.php on line 3
Hier de stuk code waar het om moet gaan:
Dit script heeft altijd gewoon gewerkt in de vorige versie van de site, maar nu geeft die kuren die ik niet thuis kan brengen.
Iemand ideetje wat er fout gaat?
De website met fout is te zien @ : www.thefugitives.tk
Ik heb een klein probleempje met een website, als ik em lokaal test draait die prima, maar als ik em online gooi krijg ik de volgende 2 foutmeldingen:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/thefugitives/public_html/index.php:2) in /home/thefugitives/public_html/index.php on line 3
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/thefugitives/public_html/index.php:2) in /home/thefugitives/public_html/index.php on line 3
Hier de stuk code waar het om moet gaan:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <?php session_start(); // ------------------------ Start Both ----------------------------------------------------- if($_COOKIE['logedin'] == 'yes' || $_SESSION['logedin'] == 'yes') { header("Location: login.php"); exit(); } // If the form was submited check if the username and password match if($_POST['Submit']){ if($_POST['username'] == 'user' && $_POST['password'] == 'pw' ){ // ------------------------ Start Both ----------------------------------------------------- // If username and password is right , store the session in a cookie setcookie ('logedin', 'John',time()+30000); // Set the length of the cookie to 30000 //Create the Session id's (as many as you want, can also do the same with cookied) $_SESSION['logedin'] = 'John'; // Redirect to the page header("Location: index.php"); exit(); } else { $error = 'Password and/or Username Not Valid, Please Try Again!'; } } ?> |
Dit script heeft altijd gewoon gewerkt in de vorige versie van de site, maar nu geeft die kuren die ik niet thuis kan brengen.
Iemand ideetje wat er fout gaat?
De website met fout is te zien @ : www.thefugitives.tk