묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
방명록 소스중에 아래처럼 에러메시지 나옵니당. 이유가 몰까여?
2002.10.10 01:18
Warning: Cannot add header information - headers already sent by (output started at c:usrwwwdbconn.php:9) in c:usrwwwwrite_ok.php on line 22
dbconn.php 소스
1<?
2 $host_name="localhost";
3 $user_name="grandking";
4 $db_name="board2";
5 $db_password="760203";
6 $connect= mysql_connect($host_name, $user_name,$db_password) or die(mysql_error());
7 mysql_select_db($db_name, $connect) or die(mysql_error());
8 ?>
9
write_ok.php 소스
1<?
include "lib.php";
include "dbconn.php";
5 if(isBlank($pwd)) message ("암호를 입력하셔야 합니다.");
if(isBlank($writer)) message ("이름을 입력하셔야 합니다.");
//if(isBlank($comment)) message ("내용을 입력하셔야 합니다.");
if((!eregi("^http://",$homepage)) &&$homepage) $homepage="http://".$homepage;
10
$ip=$REMOTE_ADDR;
$comment=nl2br($comment);
$reg_date=time();
15
$que = "insert into $table_name(ip,password,writer,homepage,email,comment,reg_date) values ('$ip','$pwd','$writer','$homepage','$email','$comment','$reg_date')";
//mysql_query(" insert into $table_name(ip,password,writer,homepage,email,comment,reg_date) values ('$ip','$password','$writer','$homepage','$email','$comment','$reg_date')",$connect) or die(mysql_error());
20
21 mysql_query($que,$connect) or die(mysql_error());
22 header("location:list.php");
?>
dbconn.php 소스
1<?
2 $host_name="localhost";
3 $user_name="grandking";
4 $db_name="board2";
5 $db_password="760203";
6 $connect= mysql_connect($host_name, $user_name,$db_password) or die(mysql_error());
7 mysql_select_db($db_name, $connect) or die(mysql_error());
8 ?>
9
write_ok.php 소스
1<?
include "lib.php";
include "dbconn.php";
5 if(isBlank($pwd)) message ("암호를 입력하셔야 합니다.");
if(isBlank($writer)) message ("이름을 입력하셔야 합니다.");
//if(isBlank($comment)) message ("내용을 입력하셔야 합니다.");
if((!eregi("^http://",$homepage)) &&$homepage) $homepage="http://".$homepage;
10
$ip=$REMOTE_ADDR;
$comment=nl2br($comment);
$reg_date=time();
15
$que = "insert into $table_name(ip,password,writer,homepage,email,comment,reg_date) values ('$ip','$pwd','$writer','$homepage','$email','$comment','$reg_date')";
//mysql_query(" insert into $table_name(ip,password,writer,homepage,email,comment,reg_date) values ('$ip','$password','$writer','$homepage','$email','$comment','$reg_date')",$connect) or die(mysql_error());
20
21 mysql_query($que,$connect) or die(mysql_error());
22 header("location:list.php");
?>