Jump to content

header already sent error


salman233

Recommended Posts

help me out guys

my code

<?php

include "conn.php";

if(isset($_POST['sumbit'])){

echo "hello";

}

if($_GET['done']=='1'){

echo "<font color='green'>inserted</font>";

}

else

{

echo mysql_error();

}

?>

<form action="page.php" method="post">

<input type="text" name="myname" id="myname" maxlength="96">

<input type="submit" name="submit" value="submit">

</form>

<?php

$rrr=addslashes($_POST['myname']);

$ddd="INSERT INTO pagination (`id`,`username`) VALUES('','$rrr')";

$ass=mysql_query($ddd);

if($ass){

header('location: page.php?done=1');

exit;

}

 

//$perpage=6;

 

//$ddw=mysql_query("SELECT COUNT (`id`) FROM `pagination`");

//$dqf=mysql_result($ddw,0);

$sss="SELECT * FROM pagination";

$see=mysql_query($sss);

echo "<table border='0' cellpadding='1' cellspacing='1'>";

while($row=mysql_fetch_assoc($see))

{

echo "<tr><td>".$row['id']."</td></tr>";

echo "<tr><td>".$row['username']."</td></tr>";

}

echo "</table>";

?>

 

 

it gives error header already sent correct me where i am wrong  here is my connection file

<?php

$fff=mysql_connect('localhost','root','');

mysql_select_db('currency',$fff);

?>

Link to comment
Share on other sites

Guest
This topic is now 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.