Jump to content

headers already sent


webclown

Recommended Posts

Hi guys I keep getting error :Cannot modify header information - headers already sent by (output started at C:\wamp\www\Tipping\common.inc:44) in C:\wamp\www\Tipping\common.inc on line 38.

But I can't see waht is worng with the code can any one help.

 

code:

<?php

function connect_db(){

  $dbhost = 'localhost';

  $dbuser = 'webuser';

  $dbpass = 'webpass';

  $dbname = 'tipping';

  $conn = mysql_connect($dbhost, $dbuser, $dbpass);

  mysql_select_db($dbname);

}

 

function close_con(){

  mysql_close();

}

 

function get_cround(){

  connect_db();

  $sql = ("SELECT * FROM admin");

  $query = mysql_query($sql);

  while ($row = mysql_fetch_array($query)){

      $cround = $row['cround'];

  }

  return $cround;

}

 

function enterTips(){

  $uid = "23";

  $round = $_REQUEST['round'];

  $query  = "INSERT INTO tips VALUES('','$uid','$round'";

  for($i=1;$i<9;$i++){

      $game = "r$round";

      $game .="g$i";

      $g1 = $_POST[$game];

      $query .= ",'$g1'";

  }

  $query .=")";

  connect_db();

  mysql_query($query);

 

  header("location:commservman.php?error=exists");

  exit;

}

?>

sory it is a bit long.

 

Link to comment
https://forums.phpfreaks.com/topic/40455-headers-already-sent/
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.