#!/usr/bin/perl #------------------ #program-ID:pet42.cgi #auther :t-egi #date :2002/2/5 #------------------ use CGI; use DBI; $query = new CGI; $t0id = $query->param('ibangou'); print "Content-Type: text/html\n\n"; #------------------- $username="egi"; if($t0id){ $dbh = DBI->connect("dbi:Pg:dbname=egi",$username) or die "Cannot connect:",$DBI->errstr; $iSelect = "Select bangou, animal, type, photo, height, weight, chara from pet_list where bangou=?"; $sth = $dbh->prepare($iSelect) or die "Cannot prepare:",$dbh->errstr(); $sth->execute($t0id) or die "Cannot execute: " , $sth->errstr(); } #------------------- print "。緝tml>\n"; print "。緝ead>。縟itle>select。�/title>\n"; print "。緡eta http-equiv=\"content-type\" content=\"text/html;charset=x-euc-jp\">\n"; print "。�/head>\n"; print "。綯ody bgcolor =LINEN>\n"; print "。緜enter>\n"; print "。緝5>\n"; print "。紵>ケケソキイ靂フ。�/I>\n"; print "。紮ORM ACTION=\"./pet44.cgi\" METHOD=\"post\">"; print "。綉ABLE BORDER = 1 bgcolor =SKYBLUE>\n"; if($t0id){ @row = $sth->fetchrow_array(); } print "。縟r>。縟h>ネヨケ譯�/th>。縟d>。緤nput type=text size=2 name=ibangou value=\"$row[0]\" 。�/td>。�/tr>\n"; print "。縟r>。縟h>ニーハェシ��/th>。縟d>。緤nput type=text size=10 name=ianimal value=\"$row[1]\" 。�/td>。�/tr>\n"; print "。縟r>。縟h>シ�爍�/th>。縟d>。緤nput type=text size=40 name=itype value=\"$row[2]\" 。�/td>。�/tr>\n"; print "。縟r>。縟h>シフソソ。�/th>。縟d>。緤nput type=text size=15 name=iphoto value=\"$row[3]\"。�/td>。�/tr>\n"; print "。縟r>。縟h>ツホケ筍�/th>。縟d>。緤nput type=text size=40 name=iheight value=\"$row[4]\"。�/td>。�/tr>\n"; print "。縟r>。縟h>ツホスナ。�/th>。縟d>。緤nput type=text size=40 name=iweight value=\"$row[5]\"。�/td>。�/tr>\n"; print "。縟r>。縟h>タュウハ。�/th>。縟d>。緤nput type=text size=120 name=ichara value=\"$row[6]\"。�/td>。�/tr>\n"; print "。�/TABLE>\n"; print "。緤nput type=\"hidden\" name=\"ibangou\" value=".$t0id.">"; if ($t0id){ print "。縣>。緤nput type=\"submit\" name=UPDATE value=\"ケケソキ\">\n"; print "。緤nput type=\"submit\" name=DELETE value=\"ヒテ\">\n"; } else{ print"。縣>。緤nput type=\"submit\" name=INSERT value=\"トノイテ\">\n"; } print "。�/FORM>"; print "。紜 HREF=\"./pet41.cgi\"フ皃�"; print "。�/CENTER>\n"; print "。�/BODY>\n"; print "。�/HTML>\n";