[PHP-users 5479] 原因は文字化けでしょうか?

Ken Fujita php-users@php.gr.jp
Mon, 18 Feb 2002 13:36:26 +0900


$B$O$8$a$^$7$F!":G6a(BPHP$B$r=i$a$F!":#(BPHP$B$G%-!<%o!<%I8!:w$N%G!<%?%Y!<%9$r:n$C(B
$B$F$$$^$9!#$7$+$78!:w$N:]$K4A;z$G(B2$BJ8;z0J>e$K$7$F$7$^$&$H!"8!:w7k2L$,$J$$(B
$B$K$J$C$F$7$^$$$^$9!#(B
$B%5!<%P$N(BOS$B$O(BDebianGNU/Linux2.2$B!"(BPHP$B$O(B4.0.6$B!"(BPostgreSQL$B$O(B7.1.3$B$G$9!#(B
EUC-JP$B$G=q$$$F$$$^$9!#(B
$B%=!<%9$O$3$s$J46$8$G$9!#(B

search.html

<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=x-euc-jp">
... <FORM ACTION="output.php" METHOD="post">
<B>$B8!:w$7$?$$%-!<%o!<%I$rF~NO$7$F$/$@$5$$!#(B</B><br><BR>
<INPUT TYPE="text" NAME="word" VALUE="" size="30" maxlength="30"><BR>
<INPUT TYPE="submit" VALUE="$B8!:w(B">
<INPUT TYPE="reset" VALUE="$B<h>C(B">


output.php

<?php
$conn=pg_Connect("dbname=reibun");
if ($word==""){
		require("./error.html");
		exit;
	}

$result = pg_Exec($conn, "select * from word where word like '%$word%'
or answer like '%$word%' or other like '%$word%'");
	$num=pg_numrows($result);
        print ("<center>");
	printf("\"%s\"$B$G8!:w$7$?7k2L(B %d $B8D8+$D$+$j$^$7$?!#(B<BR>\n",$word,
$num);
if ($num==""){
		require("./err.html");
		exit;
	}
	print ("<TABLE BORDER><br>");
	print ("<TR><Td><center>$B%-!<%o!<%I(B</center></Td><Td><center>$B@bL@(B
</center></Td><Td><center>$B$=$NB>(B</center></Td></TR>");

$num = pg_numrows($result);
for ($i=0; $i<$num; $i++) {
	$w=pg_result($result,$i,"word");
	$a=pg_result($result,$i,"answer");
	$o=pg_result($result,$i,"other");
	printf
("<tr><TD><center>%s</center></td><td><center>%s</center></td><td><cente
r>%s</center></TD></tr>",$w,$a,$o);
}
pg_Close($conn);
?>

$B$h$m$7$/$*4j$$$7$^$9!#(B

$B"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#(B 
  $B4tIl9)6H9bEy@lLg3X9;7zC[3X2J(B5$BG/!!F#ED(B $B7{(B(a0928@mail.archi.gifu-nct.ac.
jp) 
$B"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#"#(B