Jump to content

cannot modify header -plz help-


webtuto

Recommended Posts

hey i use this code

im gonna post here a part of it

its an HTML code then php then html

 

<HERE THERE IS MORE HTML CODES>
<p> </p>
		<p> </p>
		<p></td>
	<td colspan="5" background="images/Studio_musique_23.gif" valign="top">
		 
		<div align="center">
<?php
ob_start();
include("config.php");
if(!empty($_POST['nick']) and !empty($_POST['pass']) ) {
$md5=@md5($_POST['pass']);
$nick = addslashes($_POST['nick']);
$sql = "select * from `membre` where nick='$nick' and pass='$md5'";
$res=mysql_query($sql)or die(mysql_error());
$count = mysql_num_rows($res);
if($count == 1){

//id fetch-------------------------------------
$wor = mysql_query("select * from membre where nick='$nick'")or die(mysql_error());
$oop = mysql_fetch_array($wor);
//end id fetch --------------------------------
  $timestamp_expire = time() + 365*24*3600;
setcookie('nick', $_POST['nick'], $timestamp_expire); 
setcookie('pass', md5($_POST['pass']), $timestamp_expire);
setcookie('id', $oop['id'], $timestamp_expire);
echo "<meta http-equiv='refresh' content='0;url=userpanel.php'>";
}else{
echo"<center><h2>Le pseado ou le mot de passe est incorrect. Veuillez réessayer.<h2>";
}
}
ob_end_flush();
?>
<form method="post" action="">
<table border=0>
<tr><td>Pseudo :</td><td><input type="text" name="nick"></td></tr>
<tr><td>Mot de passe :</td><td><input type="password" name="pass"></td></tr>
<tr></td><td><td><input type="submit" name="send" value="      log in      "></td></tr>
</table>
</form>
		</div>
		<p> </p>
		<p> </p>
		<p> </p>
		<p> </p>
		<p> </p>
<HERE THERE IS MORE HTML CODES>

 

but the problem is that it gives this error

 

 

Warning: Cannot modify header information - headers already sent by (output started at /home/karimweb/domains/SITE/login.php:4) in /home/karimweb/domains/public_html/SITE/login.php on line 189

 

Warning: Cannot modify header information - headers already sent by (output started at /home/karimweb/domains/public_html/SITE/login.php:4) in /home/karimweb/domains/public_html/SITE/login.php on line 190

 

Warning: Cannot modify header information - headers already sent by (output started at /home/karimweb/domains/public_html/SITE/login.php:4) in /home/karimweb/domains/public_html/SITE/login.php on line 191

 

and the navigator douesnt register the cookies

the lines 189 and 190 and 191 are the lines where i write the code to register cookies on the browser

Link to comment
https://forums.phpfreaks.com/topic/101994-cannot-modify-header-plz-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.