root/trunk/install/php/foltialib.php

リビジョン 87, 17.7 kB (コミッタ: sorshi, コミット時期: 15 年 前)

foltialib.php:
escape_string()とhtmlspecialchars()をまともに使えてなかった箇所を修正。
SQLインジェクションの可能性があった箇所を修正。

Line 
1 <?php
2         
3 include("./foltia_config2.php");
4
5 /*
6 こちらのモジュールは
7 Apache + PHP + PostgreSQL 実験室
8 http://www.hizlab.net/app/
9 のサンプルを使わせていただいております。
10 ありがとうございます。
11 */
12
13     /* エラー表示の抑制 */
14     //error_reporting(0);
15
16     
17     //GET用フォームデコード
18       function getgetform($key) {
19     if ($_GET["{$key}"] != "") {
20         $value = $_GET["{$key}"];
21         $value = escape_string($value);
22         $value = htmlspecialchars($value);
23     return ($value);
24     }
25   }
26     //GET用数字フォームデコード
27       function getgetnumform($key) {
28     if ($_GET["{$key}"] != "") {
29         $value = $_GET["{$key}"];
30         $value = ereg_replace("[^-0-9]", "", $value);
31         $value = escape_numeric($value);
32     return ($value);
33     }
34   }
35     
36     //フォームデコード
37       function getform($key) {
38     if ($_POST["{$key}"] != "") {
39         $value = $_POST["{$key}"];
40         $value = escape_string($value);
41         $value = htmlspecialchars($value);
42     return ($value);
43     }
44   }
45     //数字専用フォームデコード
46       function getnumform($key) {
47     if ($_POST["{$key}"] != "") {
48         $value = $_POST["{$key}"];
49         $value = escape_string($value);
50         $value = htmlspecialchars($value);
51         $value = ereg_replace("[^0-9]", "", $value);
52         $value = escape_numeric($value);
53     return ($value);
54     }
55   }
56
57     /* 全角カタカナ化してスペースを削除してインデックス用にする */
58     function name2read($name) {
59     $name = mb_convert_kana($name, "KVC", "EUC-JP");
60     $name = mb_convert_kana($name, "s", "EUC-JP");
61     $name = ereg_replace(" ", "", $name);
62
63         return $name;
64     }
65
66     /* 数字を半角化して数字化してインデックス用にする */
67     function pnum2dnum($num) {
68     $num = mb_convert_kana($num, "a", "EUC-JP");
69     $num = ereg_replace("[^0-9]", "", $num);
70
71         return $num;
72     }
73     
74     /* 終了関数の定義 */
75     function die_exit($message) {
76         ?>
77         <p class="error"><?= $message ?></p>
78         <div class="index"><a href="./">トップ</a></div>
79     </body>
80 </html><?
81         exit;
82     }
83     
84     /* 入力した値のサイズをチェック */
85     function check_length($str, $maxlen, $must, $name) {
86         $len = strlen($str);
87         if ($must && $len == 0) {
88             die_exit("$name が入力されてません。必須項目です。");
89         }
90         if ($len > $maxlen) {
91             die_exit("$name は $len 文字以下で入力して下さい。全角文字は、一文字で二文字分と計算されます。");
92         }
93     }
94     
95     /* LIKE 用の文字列のエスケープ */
96     function escape_like($sql, $quote = TRUE) {
97         return ($quote ? "'" : "") .
98                str_replace(array("\\\\",     "%"    , "_"    ),
99                            array("\\\\\\\\", "\\\\%", "\\\\_"),
100                            pg_escape_string($sql)) .
101                ($quote ? "'" : "");
102     }
103     
104     /* SQL 文字列のエスケープ */
105     function escape_string($sql, $quote = FALSE) {
106         if ($quote && strlen($sql) == 0) {
107             return "null";
108         }
109         return ($quote ? "'" : "") .
110                pg_escape_string($sql) .
111                ($quote ? "'" : "");
112     }
113     
114     /* SQL 数値のエスケープ */
115     function escape_numeric($sql) {
116         if (strlen($sql) == 0) {
117             return "null";
118         }
119         if (!is_numeric($sql)) {
120             die_exit("$sql は数値ではありません。");
121         }
122         return $sql;
123     }
124     
125     /* PostgreSQL サーバに接続 */
126     function m_connect() {
127 /*        $con = @pg_connect("host=".DBHOST ." dbname=".DATABASE_NAME .
128                            " user=".USER_NAME .
129                            " password=".USER_PASSWORD);
130 */
131         $con = @pg_pconnect("host=".DBHOST ." dbname=".DATABASE_NAME .
132                            " user=".USER_NAME .
133                            " password=".USER_PASSWORD);
134
135
136         if (!$con) {
137             die_exit("データベースに接続出来ませんでした。");
138         }
139         /* データベースと、PHP の内部文字コードが違う場合 */
140         return($con);
141     }
142
143     /* データベースとの接続を切り離す */
144     function m_close($con) {
145         return @pg_close($con);
146     }
147
148     /* SQL 文を実行 */
149     function m_query($con, $query, $errmessage) {
150         $rtn = @pg_query($con, $query);
151         if (!$rtn) {
152             /* エラーメッセージに SQL 文を出すのはセキュリティ上良くない!! */
153             $msg = $errmessage . "<br>\n" .
154                    @pg_last_error($con) . "<br>\n" .
155                    "<small><code>" . htmlspecialchars($query) .
156                    "</code></small>\n";
157                    $rtn = @pg_query($con, "rollback");//04.4.8
158             m_close($con);
159             die_exit($msg);
160         }
161         return($rtn);
162     }
163
164     /* select した結果をテーブルで表示 */
165     function m_showtable($rs) {
166         /* 検索件数 */
167         $maxrows = pg_num_rows($rs);
168         
169         if ($maxrows == 0) {
170             echo("<p class=\"msg\">データが存在しません</p>\n");
171             return 0;
172         }
173         
174         /* フィールド数 */
175         $maxcols = pg_num_fields($rs);
176         ?>
177 <table class="list" summary="データ検索結果を表示" border="1">
178     <thead>
179         <tr>
180             <?php
181                 /* テーブルのヘッダーを出力 */
182                 for ($col = 1; $col < $maxcols; $col++) {
183                     /* pg_field_name() はフィールド名を返す */
184                     $f_name = htmlspecialchars(pg_field_name($rs, $col));
185                     echo("<th abbr=\"$f_name\">$f_name</th>\n");
186                 }
187             ?>
188         </tr>
189     </thead>
190     <tbody>
191         <?php
192             /* テーブルのデータを出力 */
193             for ($row = 0; $row < $maxrows; $row++) { /* 行に対応 */
194                 echo("<tr>\n");
195                 /* pg_fetch_row で一行取り出す */
196                 $rowdata = pg_fetch_row($rs, $row);
197                 /* 1列目にリンクを張る */
198                 echo("<td><a href=\"edit.php?q_code=" .
199                      urlencode($rowdata[0]) . "\">" .
200                      htmlspecialchars($rowdata[1]) . "</a></td>\n");
201                 for ($col = 2; $col < $maxcols; $col++) { /* 列に対応 */
202                     echo("<td>".htmlspecialchars($rowdata[$col])."<br></td>\n");
203                 }
204                 echo("</tr>\n");
205             }
206         ?>
207     </tbody>
208 </table>
209         <?php
210         return $maxrows;
211     }
212
213     /* 指定したコードのデータを表示 */
214     function m_viewdata($con, $code) {
215         /* コードに該当するデータを検索 */
216         $query = "
217 select p.code
218       ,p.name
219       ,p.email
220       ,p.pseudonym
221       ,s.name as job
222       ,p.profile
223       ,to_char(p.editdate, 'YYYY/MM/DD HH24:MI:SS') as editdate
224   from inet_profile p left join inet_job s on p.job = s.code
225  where p.code = $code";
226         $rs = m_query($con, $query, "個人情報の取得に失敗しました。");
227         if (pg_num_rows($rs) == 0) {
228             echo("<p class=\"msg\">データが存在しません</p>\n");
229             return FALSE;
230         }
231         
232         /* フィールド数 */
233         $maxcols = pg_num_fields($rs);
234         /* 先頭行 */
235         $rowdata = pg_fetch_row($rs, 0);
236         ?>
237 <table class="view" summary="データベース上のデータを表示" border="1">
238     <tr>
239         <td class="name"><?= htmlspecialchars(pg_field_name($rs, 1)) ?></td>
240         <td><a href="edit.php?q_code=<?= $rowdata[0] ?>"
241              ><?= htmlspecialchars($rowdata[1]) ?></a></td>
242     </tr>
243     <?php for ($col = 2; $col < $maxcols; $col++) { ?>
244     <tr>
245         <td class="name"><?= htmlspecialchars(pg_field_name($rs, $col)) ?></td>
246         <td><?= htmlspecialchars($rowdata[$col]) ?></td>
247     </tr>
248     <?php } ?>
249 </table>
250         <?php
251         /* クエリーを解放 */
252         pg_free_result($rs);
253         
254         return TRUE;
255     }
256     
257
258 function printhtmlpageheader(){
259
260 global $useenvironmentpolicy;
261
262 $serveruri = getserveruri();
263 $username = $_SERVER['PHP_AUTH_USER'];
264
265 print "<p align='left'><font color='#494949'><A HREF = 'http://www.dcc-jpl.com/soft/foltia/' target=\"_blank\">foltia</A> | <A HREF = './index.php'>放映予定</A> | <A HREF = './index.php?mode=new'>新番組</A> | <A HREF = './listreserve.php'>予約一覧</A> | <A HREF = './titlelist.php'>番組一覧</A> | <A HREF = './viewepg.php'>番組表</A> | 録画一覧(<A HREF = './showplaylist.php'>録画順</A>・<A HREF = './showplaylist.php?list=title'>番組順</A>・<A HREF = './showplaylist.php?list=raw'>全</A>) | <A HREF = './showlib.php'>録画ライブラリ</A> |  <A HREF = './folcast.php'>Folcast</A>[<a href=\"itpc://$serveruri/folcast.php\">iTunesに登録</a>] | ";
266 if ($useenvironmentpolicy == 1){
267     print "【 $username 】";
268 }
269
270 print "</font></p>\n";
271
272 }
273
274
275 function renderepgstation($con,$stationname,$start){ //戻り値 なし EPGの局表示
276
277 $now = date("YmdHi");
278 $today = date("Ymd");   
279 $tomorrow = date ("Ymd",mktime(0, 0, 0, date("m")  , date("d")+1, date("Y")));
280 //$today = "20051013";   
281 //$tomorrow = "20051014";
282 //$epgstart = $today . "2000";
283 $epgstart = $start ;
284 //$epgend = $tomorrow . "0400";
285 $epgend = calcendtime($start , (8*60));
286 $query = "
287 SELECT startdatetime , enddatetime , lengthmin , epgtitle , epgdesc , epgcategory  ,ontvchannel  ,epgid
288 FROM foltia_epg
289 WHERE foltia_epg.ontvchannel = '$stationname' AND
290 enddatetime  > $epgstart  AND
291 startdatetime  < $epgend 
292 ORDER BY foltia_epg.startdatetime  ASC
293     ";
294     $rs = m_query($con, $query, "DBクエリに失敗しました");
295     $maxrows = pg_num_rows($rs);
296 if ($maxrows == 0) {
297         print("番組データがありません<BR>");           
298 }else{
299 print "<table width=\"100%\"  border=\"0\">\n";
300 //print "<ul><!-- ($maxrows) $query -->\n";
301
302 for ($row = 0; $row < $maxrows; $row++) {
303     
304 $rowdata = pg_fetch_row($rs, $row);
305
306 $printstarttime = substr($rowdata[0],8,2) . ":" substr($rowdata[0],10,2);
307 $tdclass = "t".substr($rowdata[0],8,2) .  substr($rowdata[0],10,2);
308 $title = htmlspecialchars($rowdata[3]);
309 $title = z2h($title);
310 $desc = htmlspecialchars($rowdata[4]);
311 $desc = z2h($desc);
312 $height htmlspecialchars($rowdata[2]) * 3;
313 $epgid htmlspecialchars($rowdata[7]);
314
315 print"
316       <tr>
317         <td height = \"$height\" >$printstarttime  <A HREF=\"./reserveepg.php?epgid=$epgid\">$title</A> $desc <!-- $rowdata[0] - $rowdata[1] --></td>
318       </tr>
319 ";
320 /*print"<li style=\"height:" . $height ."px;\" class=\"$tdclass\">
321 $printstarttime  <A HREF=\"./reserveepg.php?epgid=$epgid\">$title</A> $desc($rowdata[0] - $rowdata[1])
322 </li>\n";
323 */
324 }//for
325 //print "</ul>\n";
326 print "</table>\n";
327
328 }//if
329 }//end function
330
331 function calcendtime($start,$lengthmin){//戻り値 終了時刻(Ex:200510170130)
332 $startyear =   substr($start,0,4);
333 $startmonth =   substr($start,4,2);
334 $startday =   substr($start,6,2);
335 $starthour =   substr($start,8,2);
336 $startmin =   substr($start,10,2);
337 //int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )
338 $endtime = date ("YmdHi",mktime($starthour  , $startmin + $lengthmin , 0, $startmonth  , $startday, $startyear));
339
340 return ($endtime );
341 }//end function
342
343
344 function z2h($string){ //戻り値 半角化した文字
345     $stringh = mb_convert_kana($string, "a", "EUC-JP");
346  return ($stringh );
347 }
348
349 function foldate2rfc822($start){//戻り値 RFC822スタイルの時刻表記
350     $startyear =   substr($start,0,4);
351     $startmonth =   substr($start,4,2);
352     $startday =   substr($start,6,2);
353     $starthour =   substr($start,8,2);
354     $startmin =   substr($start,10,2);
355
356     $rfc822 = date ("r",mktime($starthour  , $startmin , 0, $startmonth  , $startday, $startyear));
357     
358     return ($rfc822);
359 }//end sub
360
361 function foldate2print($start){//戻り値 日本語風時刻表記
362     $startyear =   substr($start,0,4);
363     $startmonth =   substr($start,4,2);
364     $startday =   substr($start,6,2);
365     $starthour =   substr($start,8,2);
366     $startmin =   substr($start,10,2);
367
368     $printabledate = date ("Y/m/d H:i",mktime($starthour  , $startmin , 0, $startmonth  , $startday, $startyear));   
369     return ($printabledate);
370 }//end sub
371
372 function getserveruri(){//戻り値 サーバアドレス Ex.www.dcc-jpl.com:8800/soft/foltia/
373
374 //リンクURI組み立て
375 $sv6 = $_SERVER['SCRIPT_NAME'];///dameNews/sarasorjyu/archives.php
376 $sv8 = $_SERVER['SERVER_NAME'];//sync.dcc-jpl.com
377 $sv9 = $_SERVER['SERVER_PORT'];
378 if ($sv9 == 80){
379     $port = "";
380 }else{
381     $port = ":$sv9";
382 }
383 $a = split("/", $sv6);
384 array_pop($a);
385
386 $scriptpath = implode("/", $a);
387
388 $serveruri = "$sv8$port$scriptpath";
389 return ($serveruri );
390 }//end sub
391
392
393 function getserverfqdn(){//戻り値 サーバアドレス Ex.www.dcc-jpl.com:8800
394
395 //リンクURI組み立て
396 $sv6 = $_SERVER['SCRIPT_NAME'];///dameNews/sarasorjyu/archives.php
397 $sv8 = $_SERVER['SERVER_NAME'];//sync.dcc-jpl.com
398 $sv9 = $_SERVER['SERVER_PORT'];
399 if ($sv9 == 80){
400     $port = "";
401 }else{
402     $port = ":$sv9";
403 }
404 $a = split("/", $sv6);
405 array_pop($a);
406
407 $scriptpath = implode("/", $a);
408
409 $serveruri = "$sv8$port";
410 return ($serveruri );
411 }//end sub
412
413
414 function printdiskusage(){//戻り値 なし
415 list (, $all, $use , $free, $usepercent) =  getdiskusage();
416
417 print "
418 <div style=\"width:100%;border:1px solid black;text-align:left;\"><span style=\"float:right;\">$free</span>
419 <div style=\"width:$usepercent;border:1px solid black;background:white;\">$use/$all($usepercent)</div>
420 </div>
421 ";
422 //exec('ps ax | grep ffmpeg |grep MP4 ' ,$ffmpegprocesses);
423 }//end sub
424
425
426 function getdiskusage(){//戻り値 配列 [,全体容量, 使用容量 , 空き容量, 利用割合]
427
428 global $recfolderpath,$recfolderpath;
429
430     exec ( "df -h  $recfolderpath | grep $recfolderpath", $hdfreearea);
431     $freearea = preg_split ("/[\s,]+/", $hdfreearea[0]);
432
433     return $freearea;
434     
435 }//endsub
436
437
438 function printtrcnprocesses(){
439
440 $ffmpegprocesses = `ps ax | grep ffmpeg | grep -v grep |  wc -l `;
441 $uptime = exec('uptime');
442
443 print "<div style=\"text-align:left;\">";
444 print "$uptime<br>\n";
445 print "トラコン稼働数:$ffmpegprocesses<br>\n";
446 print "</div>";
447
448 }//endsub
449
450
451 function warndiskfreearea(){
452
453 global $demomode;
454
455 if ($demomode){
456 print "<!-- demo mode -->";
457 }else{
458
459 global $recfolderpath,$hdfreearea ;
460
461     exec ( "df   $recfolderpath | grep $recfolderpath", $hdfreearea);
462     $freearea = preg_split ("/[\s,]+/", $hdfreearea[0]);
463 $freebytes = $freearea[3];
464 if ($freebytes == "" ){
465 //
466 //print "<!-- err:\$freebytes is null -->";
467 }elseif($freebytes > 1024*1024*100 ){// 100GB以上あいてれば
468 //なにもしない
469 print "<style type=\"text/css\"><!-- --></style>";
470 }elseif($freebytes > 1024*1024*50 ){// 100GB以下
471 print "<style type=\"text/css\"><!--
472     body {
473     background-color: #CCCC99;
474      }
475 -->
476 </style>
477 ";
478 }elseif($freebytes > 1024*1024*30 ){// 50GB以下
479 print "<style type=\"text/css\"><!--
480     body {
481     background-color:#CC6666;
482      }
483 -->
484 </style>
485 ";
486 }elseif($freebytes > 0 ){// 30GB以下
487 print "<style type=\"text/css\"><!--
488     body {
489     background-color:#FF0000;
490      }
491 -->
492 </style>
493 ";
494 }else{ //空き容量 0バイト
495 print "<style type=\"text/css\"><!--
496     body {
497     background-color:#000000;
498      }
499 -->
500 </style>
501 ";
502 }//endif freebytess
503
504 }//endif demomode
505
506 }//endsub
507
508
509
510 function foldatevalidation($foldate){
511
512 if (strlen($foldate) == 12 ){
513
514     $startyear =   substr($foldate,0,4);
515     $startmonth =   substr($foldate,4,2);
516     $startday =   substr($foldate,6,2);
517     $starthour =   substr($foldate,8,2);
518     $startmin =   substr($foldate,10,2);
519
520     $startepoch = date ("U",mktime($starthour  , $startmin , 0, $startmonth  , $startday, $startyear));   
521     $nowe = time();
522     if ($startepoch > $nowe){
523     //print "$foldate:$startepoch:$nowe";
524         return TRUE;
525     }else{
526         return FALSE;
527     }    //end if $startepoch > $nowe
528 }else{
529     return FALSE;
530 }//end if ($foldate) == 12
531
532 }//end function
533
534
535
536 function login($con,$name,$passwd){
537 global $environmentpolicytoken;
538
539 //入力内容確認
540  if (((mb_ereg('[^0-9a-zA-Z]', $name)) ||(mb_ereg('[^0-9a-zA-Z]', $passwd) ))){
541     
542     //print "エラー処理\n";
543     //print "<!-- DEBUG name/passwd format error-->";
544     redirectlogin();
545     
546 }else{
547 //print "正常処理\n";
548 //db検索
549 escape_string($name);
550 escape_string($passwd);
551
552 $query = "
553 SELECT memberid ,userclass,name,passwd1
554 FROM foltia_envpolicy
555 WHERE foltia_envpolicy.name  = '$name' 
556     ";
557     $useraccount = m_query($con, $query, "DBクエリに失敗しました");
558     $useraccountrows = pg_num_rows($useraccount);
559     
560     if ($useraccountrows == 1 ){
561         $rowdata = pg_fetch_row($useraccount, 0);
562         $memberid = $rowdata[0];
563         $userclass = $rowdata[1];
564         $username $rowdata[2];
565         $dbpasswd = $rowdata[3];
566     }else{
567         header("HTTP/1.0 401 Unauthorized");
568         //print "<!-- DEBUG DB record error ($useraccountrows)-->";
569         redirectlogin();
570     }//end if
571
572
573 // passwdをdbから取りだし
574 if ($userclass == 0){
575 $dbpasswd = "$dbpasswd";
576 }else{
577 // db passwdとトークンを連結し
578 $dbpasswd = "$dbpasswd"."$environmentpolicytoken";
579 }
580 //それが入力と一致すれば認証
581 if ($passwd == $dbpasswd) {
582 //print "認証成功<br>$dbpasswd  $passwd\n";
583 }else{
584 //print "認証失敗<br>$dbpasswd  $passwd\n";
585         header("HTTP/1.0 401 Unauthorized");
586         //print "<!-- DEBUG passwd unmatch error>";
587         redirectlogin();
588 }
589 }//end if mb_ereg
590 }//end function login
591
592
593
594
595 function redirectlogin(){
596 global $environmentpolicytoken;
597
598 print "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n";
599 print "<html><head>\n";
600 print "<title>foltia:Invalid login</title>\n";
601 print "</head><body>\n";
602 print "<h1>Invalid login</h1>";
603 print "<p>foltiaヘのアクセスにはログインが必要です。再ログインはリロードやブラウザ再起動で、新規アカウント登録は<a href=\"./accountregist.php\">こちらから。</a></p>";
604 if ($environmentpolicytoken == ""){
605 }else{
606     print "<p>突然この画面が表示された場合にはセキュリティコードが変更されたかも知れません。</p>";
607 }
608 print "</p><hr>\n";
609 print "<address>foltia by DCC-JPL Japan/foltia Project.  <a href = \"http://www.dcc-jpl.com/soft/foltia/\">http://www.dcc-jpl.com/soft/foltia/</a></address>\n";
610 print "</body></html>\n";
611
612
613
614 exit;
615 }//end function redirectlogin
616
617 function getuserclass($con){
618 global $useenvironmentpolicy;
619 $username = $_SERVER['PHP_AUTH_USER'];
620
621 if ($useenvironmentpolicy == 1){
622 $query = "
623 SELECT memberid ,userclass,name,passwd1
624 FROM foltia_envpolicy
625 WHERE foltia_envpolicy.name  = '$username' 
626     ";
627         $useraccount = m_query($con, $query, "DBクエリに失敗しました");
628     $useraccountrows = pg_num_rows($useraccount);
629     
630     if ($useraccountrows == 1 ){
631         $rowdata = pg_fetch_row($useraccount, 0);
632         //$userclass = $rowdata[1];
633         return ($rowdata[1]);
634     }else{
635     return (99);//エラー
636     }//end if
637     
638 }else{
639     return (0);//環境ポリシー使わないときはつねに特権モード
640 }//end if
641 }//end function getuserclass
642
643
644
645 function getmymemberid($con){
646 global $useenvironmentpolicy;
647 $username = $_SERVER['PHP_AUTH_USER'];
648
649 if ($useenvironmentpolicy == 1){
650 $query = "
651 SELECT memberid ,userclass,name,passwd1
652 FROM foltia_envpolicy
653 WHERE foltia_envpolicy.name  = '$username' 
654     ";
655         $useraccount = m_query($con, $query, "DBクエリに失敗しました");
656     $useraccountrows = pg_num_rows($useraccount);
657     
658     if ($useraccountrows == 1 ){
659         $rowdata = pg_fetch_row($useraccount, 0);
660         //$userclass = $rowdata[1];
661         return ($rowdata[0]);
662     }else{
663     return (-1);//エラー
664     }//end if
665     
666 }else{
667     return (0);//環境ポリシー使わないときはつねに特権モード
668 }//end if
669 }//end function getuserclass
670
671
672 function getmemberid2name($con,$memberid){
673 global $useenvironmentpolicy;
674 //$username = $_SERVER['PHP_AUTH_USER'];
675
676 if ($useenvironmentpolicy == 1){
677 $query = "
678 SELECT memberid ,userclass,name,passwd1
679 FROM foltia_envpolicy
680 WHERE foltia_envpolicy.memberid  = '$memberid' 
681     ";
682         $useraccount = m_query($con, $query, "DBクエリに失敗しました");
683     $useraccountrows = pg_num_rows($useraccount);
684     
685     if ($useraccountrows == 1 ){
686         $rowdata = pg_fetch_row($useraccount, 0);
687         return ($rowdata[2]);
688     }else{
689     return ("");//エラー
690     }//end if
691     
692 }else{
693     return ("");
694 }//end if
695
696
697
698 }//end function getmemberid2name
699
700 ?>
701
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed