Ik krijg dit als je een inlogsysteem plaats

Gestart doorHabwop13 reacties53 weergaven

14 berichten · pagina 1 van 1

Habwop

Lid · Topicstarter

Berichten
90
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als ik een inlogsysteem op mn site plaats krijg ik dit te zien:"Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/habwop/domains/habbodaily.nl/public_html/index.php:13) in /home/habwop/domains/habbodaily.nl/public_html/config.php on line 15".

En het zelfde geld voor een upload script. Mij vraag is hoe komt dit?
0
Berichten
1.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mag ik dan een stuk code zien?

(dan kan ik kijken wat er fout is..)
0
Habwop

Lid · Topicstarter

Berichten
90
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
www.habbodaily.nl

Ik hebt alleen op deze host , bij gratis host woelmuis heb ik er geen last van
0
Berichten
832
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ligt meestal aan dat je 2 keer de sessie start.
Kijk even in al je includes of daar de sessie word gestart.
0
Berichten
1.000
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet session_start() altijd boven aan alles hebben staan (er mag niks boven) anders krijg je dat probeer session_start() maar eens boven alles te zetten
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dit heb ik ook soms als je in de config ook een session_start() zet
0
Habwop

Lid · Topicstarter

Berichten
90
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zie t gene nergens staan?

Dit is de index:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">




Habbodaily







Bruut:"Berichten balk tijdelijk uitgeschakelt i.v.m bug"(webmaster)

 

 



Latest News
Latest News
Radio Stats

 

Competitions

And meee

Content
/// Start van installatie check ///
if(!isset($var) && file_get_contents("config.php") == "") {
include(pagina/maakconfig.php);
die();
}else{
require_once(class/head.class.php);
}
/// Einde van installatie check ///
?>
Pagina


Leden menu
/// Start van installatie check ///
if(!isset($var) && file_get_contents("config.php") == "") {
include(pagina/maakconfig.php);
die();
}else{
require_once(class/head.class.php);
}
/// Einde van installatie check ///
?>
Menu

Afbeelding


0
Berichten
1.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wat staat er in config.php?
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
<!--[if IE 6]>
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR] ?>
<link href="./styles/ie6.css" rel="stylesheet" type="text/css" />
<![endif]--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>

<title>Habbodaily</title>
<link href="styles/layout.css" rel="stylesheet" type="text/css" />
<link href="styles/print.css" rel="stylesheet" type="text/css" />



<meta name="description" content="Habbodaily brengt het laaste Habbo nieuws in jouw brievenbus!" />
<meta name="keywords" content="Habbodaily ,Habbodailly, Hslive, Habbo, Habbo Nederland, Fansite, Habbofansite" />
<meta name="author" content="bruut.." />

</head>
<body><br>
<center><div id="menu"><marquee>Bruut:"Berichten balk tijdelijk uitgeschakelt i.v.m bug"<font color="red">(webmaster) </font></marquee></div></center><br>
<div id="container">
<div id="header">
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div id="menu">
</select>
</form></div>

<right><div id="subheader">
<div id="news">
<div class="black">Latest News</div>
</div>

<div id="news">
<div class="black">Latest News</div>
</div>

<div id="zesty"></div>
</div>




<div id="subcontainer">
<div id="left">
<div class="top"></div>
<div class="text">
<div class="green">Radio Stats </div>
<p>&nbsp;</p>
<p>
</div>
<div class="bottom"></div>

<div class="top"></div>
<div class="text">
<div class="red">Competitions</div>
<p>And meee</p>
</div>
<div class="bottom"></div>
</div>


<div id="center">
<div id="content_top"></div>
<div id="content">
<div class="blue">Content</div>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/// Start van installatie check ///[/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]$var[/COLOR][COLOR= #007700]) &&[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina/maakconfig.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]class/head.class.php[/COLOR][COLOR= #007700]);
}[/COLOR]
[COLOR= #FF8000]/// Einde van installatie check ///[/COLOR]
?>
<strong>Pagina</strong><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina.php[/COLOR][COLOR= #007700]);[/COLOR] ?>

</div>
<div id="content_bottom"></div>

</div>


<div id="right">
<div class="top"></div>
<div class="text">
<div class="purple">Leden menu</div>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/// Start van installatie check ///[/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]$var[/COLOR][COLOR= #007700]) &&[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina/maakconfig.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]class/head.class.php[/COLOR][COLOR= #007700]);
}[/COLOR]
[COLOR= #FF8000]/// Einde van installatie check ///[/COLOR]
?>
<strong>Menu</strong><br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]menu.php[/COLOR][COLOR= #007700]);[/COLOR] ?>
</div>
<div class="bottom"></div>
</div>

<div id="clear"><br />
</div>
</div>
<img src="images/bottom.gif" width="955" height="22" /></div>
</body>


</html>
0
Habwop

Lid · Topicstarter

Berichten
90
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rohimma schreef:
wat staat er in config.php?
if(!function_exists("file_put_contents")) {
function file_put_contents($url, $data) {
$filehandle = fopen($url, a);
fwrite($filehandle, $data);
fclose($filehandle);
}
}

?>
Afbeelding



chmod(config.php, 0777);

if(is_writable("config.php") == false) {
echo "Foutje opgetreden

config.php moet schrijfbaar zijn, Maak zijn permissions 777

Weet je niet hoe dit moet? CHMOD, lees hier
";
die();
}
?>

if(isset($_POST[submit]) && !empty($_POST[username]) && !empty($_POST[password]) && !empty($_POST[host]) && !empty($_POST[database]) && mysql_connect($_POST[host],$_POST[username],$_POST[password]) == true && mysql_select_db($_POST[database]) == true) {

file_put_contents("config.php",$mysql_host = ".$_POST[host]."; // dit is meestal localhost
$mysql_user = ".$_POST[username]."; // voer hier je username van mysql in
$mysql_password = ".$_POST[password]."; // voer hier je mysql wachtwoord in
$mysql_database = ".$_POST[database]."; // hier vul je de naam van je database in
if(mysql_connect($mysql_host,$mysql_user,$mysql_password) == false && mysql_select_db($mysql_database) == false) {
echo "De connectie met je database is niet correct, open config.php en verander de mysql gegevens, Die je van je host hebt gekregen.";
die();
}else{
mysql_connect($mysql_host,$mysql_user,$mysql_password);
mysql_select_db($mysql_database);
}
$var = "ja";

session_start();
?>);
if(file_exists("config.php")) {
echo "De MySQL config.php is succesvol aangemaakt.
U kunt nu verder gaan met de installatie.
Installeren
";
}else{
echo Het lukt niet om config.php aan te maken.
Probeer hem zelf aan te maken, Maak in de hoofd map (dus in de map waar index.php in staat) een bestand aan genaamd config.php met deze inhoud:


$mysql_host = ".$_POST[host]."; // dit is meestal localhost
$mysql_user = ".$_POST[username]."; // voer hier je username van mysql in
$mysql_password = ".$_POST[password]."; // voer hier je mysql wachtwoord in
$mysql_database = ".$_POST[database]."; // hier vul je de naam van je database in
if(mysql_connect($mysql_host,$mysql_user,$mysql_password) == false && mysql_select_db($mysql_database) == false) {
echo "De connectie met je database is niet correct, open config.php en verander de mysql gegevens, Die je van je host hebt gekregen.";
die();
}else{
mysql_connect($mysql_host,$mysql_user,$mysql_password);
mysql_select_db($mysql_database);
}

session_start();
?>;
}
}else{
if(isset($_POST[submit])) {
if(mysql_connect($_POST[host],$_POST[username],$_POST[password]) == false || mysql_select_db($_POST[database]) == false) {
echo "Er zijn wat gegevens die niet kloppen, Want er kan geen connectie met de database gelegd worden.
";
}
}
?>

}
?>
0
Berichten
3.225
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Pffff, maybe eens googlen? En anders eens ctrl + f gebruiken in je codes en dan eens kijken voor session_start();
Als er in een script dubbel is, eruit halen.
0
Habwop

Lid · Topicstarter

Berichten
90
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@streedie
Altijd zo chagerijnig? Denk je dat niet heb gegoogled dan? Op habbers zegen ze dat aan de host ligt. Want op een gratis site heb je nergens last van

Krijg als nog de melding , ik heb session_start();
?>); er uit gehaalt over , en nog steeds de zelfde melding.
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
In config haal je de regel

session_start();


helemaal weg,
en HELEMAAL bovenaan je index pagina zet je:

[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR] ?>


Dat komt dus als ALLEREERSTE op de pagina. Boven al het andere.

Dan moet et werken biggrin
0
Berichten
921
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb al wel zo idee waarom je errors krijgt:

zet dit eens helemaal boven aan de pagina en maar 1x

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/// Start van installatie check ///[/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]$var[/COLOR][COLOR= #007700]) &&[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina/maakconfig.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/die"]die[/URL][COLOR= #007700]();
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]class/head.class.php[/COLOR][COLOR= #007700]);
}[/COLOR]
[COLOR= #FF8000]/// Einde van installatie check ///[/COLOR]
?>


Je doet deze boven zowat elke content en dan gaat het niet werken nee smile
Edit: je moet 1x boven aan de index.php dit zetten niet meer, anders verzend je 2x de config die een session_start(); functie gebruikt, en al doe je dus die script 2x gebruiken dan verzend hij hem ook 2x en dat is dan een error.

Ik zelf werk al een 5/6 maanden met phpmenno en ik ken de basis in preciepe uit mijn kop winkTeminste die config is het zelfde als van phpmenno dus het lijkt me dat jij die gebruikt yummie
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