2 errors

Gestart doorJacmob14 reacties23 weergaven

15 berichten · pagina 1 van 1

Jacmob

Lid · Topicstarter

Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/stickycr/public_html/index.php:2) in /home/stickycr/public_html/includes/config.inc.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /home/stickycr/public_html/index.php:2) in /home/stickycr/public_html/index.php on line 14

Ik krijg dus deze2 errors confused
config.inc.php :

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
@author: Jeffrey Ponsen [jponsen.nl]
@copyright 2012 - 2013
*/[/COLOR]

[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]

[COLOR= #FF8000]// MySQL Gegevens[/COLOR]
[COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]host[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]*[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Host[/COLOR]
[COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]*[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Gebruikersnaam[/COLOR]
[COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]*[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Wachtwoord[/COLOR]
[COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]data[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]*[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Database[/COLOR]

[COLOR= #0000BB]$adminnaam[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]kev30[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$dbc[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]host[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$dbc[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is een fout opgetreden: [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700](); }[/COLOR]

[COLOR= #0000BB]$data[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$conf[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sql[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]data[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700]) {[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er is een fout opgetreden: [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700](); }[/COLOR]

?>


index.php lijn 1 tot 15

<!DOCTYPE html>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
@author: Jeffrey Ponsen [jponsen.nl]
@copyright 2012 - 2013
*/[/COLOR]

[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]includes/config.inc.php[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$go[/COLOR] [COLOR= #007700]=[/COLOR] TRUE[COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]US[/COLOR][COLOR= #007700]])) {[/COLOR]
  [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Location: loggedin.php[/COLOR][COLOR= #007700]);
}[/COLOR]
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
1. Haal de witregel voor session_start() weg.
0
Jacmob

Lid · Topicstarter

Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Done geen changes

Btw ik had perongeluk stukje weg gehaald moment
0
Berichten
3.112
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Session_start() moet helemaal bovenaan...
0
Jacmob

Lid · Topicstarter

Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Kijk het probleem is OP de eene site werkt hij maar op me test domein werkt hij niet terwel het hetzelfde script is
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<!DOCTYPE html>


moet na

require_once includes/config.inc.php;


Deze fout is:
1) heel googlebaar
2) Hier al 56843846844x gepost wat wil zeggen dat je zoeken had kunnen gebruiken
3) Gemakkelijk zelf op te lossen gewoon door te lezen
4) zo klein en gemakkelijk dat hier een topic voor is "kleine fouten" ofzoiets.
0
Jacmob

Lid · Topicstarter

Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe kan dat erna als confused maar hij redict nu niet
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jacmob schreef:
Hoe kan dat erna als confused
maar hij redict nu niet
Leer eens php als je aanpassingen gaat doen sm_eerieWat je kan doen:

?>
je doctype
<?php


of

echo "je doctype";


of

print, shorthand php, whatever er nog allemaal is.
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gamedealer schreef:
Session_start() moet helemaal bovenaan...
Dat is echt onzin....
Zolang het maar boven al het sessie gebeuren staat..
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Freestyle schreef:
Eerdere citaten tonen
Gamedealer schreef:
Session_start() moet helemaal bovenaan...
Dat is echt onzin....
Zolang het maar boven al het sessie gebeuren staat..
Volgens mij moet het net als je headers vóór de html.
0
Jacmob

Lid · Topicstarter

Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het werkt nog niet confused??
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Zet de include boven de doctype omdat er al een output is.
0
Berichten
7.681
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rogier schreef:
Eerdere citaten tonen
Freestyle schreef:
Eerdere citaten tonen
Gamedealer schreef:
Session_start() moet helemaal bovenaan...
Dat is echt onzin....
Zolang het maar boven al het sessie gebeuren staat..
Volgens mij moet het net als je headers vóór de html.
Dat maakt niet uit, het is alleen wel netter.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Freestyle schreef:
Eerdere citaten tonen
Rogier schreef:
Eerdere citaten tonen
Freestyle schreef:
Eerdere citaten tonen
Gamedealer schreef:
Session_start() moet helemaal bovenaan...
Dat is echt onzin....
Zolang het maar boven al het sessie gebeuren staat..
Volgens mij moet het net als je headers vóór de html.
Dat maakt niet uit, het is alleen wel netter.
Er mag geen output boven de session start of een Header zitten.

Html is een output

Quote:

If you are receiving errors like:

ERROR Warning: session_start() [function.session-start]: "Cannot send session cookie - headers already sent by (output started at... "

...or...

"Warning: session_start(); [function.session-start]: Cannot send session cache limiter - headers already sent".

...ensure that session_start(); is literally at the very top of your script, even before any DOCTYPE declaration, eg:

[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR] ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>...

...and, if using an included header file, ensure that the above approach is used in the header file, with the header file request right at the top of the script that it is being called from, eg:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]/var/header_file.php[/COLOR][COLOR= #007700];[/COLOR]
0
Jacmob

Lid · Topicstarter

Berichten
916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hij werkt inmiddels al ik heb geen idee wat er nou was
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren