Session start fout

Gestart doorShahiem9 reacties36 weergaven

10 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg een error melding , maar bij een andere host waar ik het probeerde , kreeg ik geen foutmelding.

Hieronder staat de error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/shahiem/domains/mijnwebsitel/public_html/header.tpl:11) in /home/shahiem/domains/mijnwebsite/public_html/main_register.php on line 5
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
laat session_start op de pagina waar je die error krijgt eens weg..
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nah, doet he tnig niet
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heef code eens...
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]

[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]header.tpl[/COLOR][COLOR= #007700];[/COLOR]

?>

[COLOR= #0000BB]<?[/COLOR]

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

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/session_is_registered"]session_is_registered[/URL][COLOR= #007700]([/COLOR]myusername[COLOR= #007700])){[/COLOR]

[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"location:login_success.php?msg=allreadylogin"[/COLOR][COLOR= #007700]);[/COLOR]

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

}[/COLOR]

?>







<h3>Registreren</h3>    

<form action="checkregister.php" method="post" name="register" id="contactform">

[COLOR= #0000BB]<?php[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]msg[/COLOR][COLOR= #007700]])) {[/COLOR]

   [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]msg[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]username[/COLOR][COLOR= #007700]) {[/COLOR]

       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<p>

U gebruikersnaam is al in gebruik, kies alstublieft een nieuwe.</p>[/COLOR][COLOR= #007700];

   }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]msg[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]field[/COLOR][COLOR= #007700]) {[/COLOR]

       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<p>U heeft niet alle velden (correct) ingevuld. U moet alle velden invullen om te registreren.</p>[/COLOR][COLOR= #007700]; 

   }[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]msg[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]password[/COLOR][COLOR= #007700]) {[/COLOR]

       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<p>De door u ingevoerde wachtwoorden komen niet overeen. Probeer opnieuw.</p>[/COLOR][COLOR= #007700]; 

   }

}[/COLOR]



?>

    

            





<p>    

<label for="username">Gebruikersnaam*</label><br>

<input name="username" type="text" id="username" tabindex="1">

</p>



<p>    

<label for="password">Wachtwoord*</label><br>

<input name="password" type="password" id="password" tabindex="2">

</p>



<p>    

<label for="passwordcheck">Wachtwoord (Controle)*</label><br>

<input name="passwordcheck" type="password" id="passwordcheck" tabindex="3">

</p>



<p>    

<label for="email">Email*</label><br>

<input name="email" type="text" id="email" tabindex="4">

</p>



<p>    

<label for="Straat">Straat*</label><br>

<input name="Straat" type="text" id="Straat" tabindex="5">

</p>



<p>    

<label for="Huisnummer">Huisnummer*</label><br>

<input name="Huisnummer" type="text" id="Huisnummer" tabindex="6">

</p>



<p>    

<label for="Plaats">Plaats*</label><br>

<input name="Plaats" type="text" id="Plaats" tabindex="7">

</p>



<p>    

<label for="Postcode">Postcode*</label><br>

<input name="Postcode" type="text" id="Postcode" tabindex="8">

</p>



<p class="no-border">

<input class="button" value="Submit" name="submit" id="submit" tabindex="9" type="submit">



<input class="button" value="Reset" tabindex="10" type="reset">    

</p>







</form>



[COLOR= #0000BB]<?php[/COLOR]

[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]footer.tpl[/COLOR][COLOR= #007700];[/COLOR]

?>
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
O Jawel het lukt wle , had iets heel anders gedaan xD
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet session_start(); ook helemaal bovenaan je pagina zetten, dus meteen na de eerste
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Jup, je include header.tpl, wat waarschijnlijk HTML of iets dergelijks op je pagina weergeeft, daardoor worden de headers van de pagina al verzonden, en kan je de sessie niet meer starten.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
en er staat ook een enter voor de
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thnx voor hulp!biggrin
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