[PHP-users 2057] セッションの使い方について

T.Ito php-users@php.gr.jp
Fri, 14 Sep 2001 12:44:36 +0900


いつも参考にさせて頂いております。
session_start();
を実行すると,その行から下記のメッセージが出ます。

Warning: Cannot send session cookie - headers already sent by (output
started at /home/sites/home/web/index.php:2) in
/home/sites/home/web/index.php on line 5
Warning: Cannot send session cache limiter - headers already sent (output
started at /home/sites/home/web/index.php:2) in
/home/sites/home/web/index.php on line 5

サーバー上のtmpというディレクトリにはセッションファイルが実行の度に発行され
てます。
お見苦しいPgで恐縮ですが,アドバイス頂ければと思います。


<?php
session_start();
session_register(userid);

require("../ini/test.inc");

function hyouji()
{
?>

<form action= "index.php?<?=SID?>">

HTML文のエリア

<?
}

if($mode == OK){	// blank_check($tantousya_code,"担当者番号が未入力です。
");
			// field_check("^[0-9]+$",$tantousya_code,"担当者番号の入力が正しくあ
りません。");
		conection();
		$sql = "select * from table";

		$result = pg_exec($sql);
		printd("\$sql = $sql");
		$s = select_check($result,pg_numrows(pg_exec($sql)));

		if($kousin == 1){			}
		else{		}

		}


?>

******************************************************
T.Ito

FujiFortune co.,ltd
TEL:054(273)0036  //  FAX:054(273)0038
URL http://www.fujif.co.jp/  Mail t-ito@fujif.co.jp
******************************************************