php3 compatibility? - Mailing list pgsql-general

From アムス
Subject php3 compatibility?
Date
Msg-id 001701c28c1c$d22c80a0$d4a6fea9@LocalHost
Whole thread Raw
Responses Re: OT: php3 compatibility?  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-general
My current PHP is version 4.22. However, the program I installed was
developed to use PHP 3.0.15 with extention to php3.

Now the problem I found was that somehow include statement is not really
working.

Here I include the code for menu.php3. This calls to include for admchk.func
and gw.conf file. However, they seem not to be included within menu.php3.

menu.php3 ------------------------------------------------------
<?
 include("gw.conf");
 include("include/admchk.func");
 $conn = @pg_Connect($host,"5432","","",$masterdb);
 if (!$conn) {
  echo "<B>・ヌ。シ・ソ・ル。シ・ケタワツウ、ヒシコヌヤ、キ、゛、キ、ソ。」</B><BR>\n";
  exit;
 }
?>
<HTML>
<?//include("include/body.conf")?>
<BODY BACKGROUND="images/<?echo $menubg?>"  MARGINHEIGHT="0" MARGINWIDTH="0"
TOPMARGIN="0" LEFTMARGIN="0">

<TABLE BORDER=0 CELLPADDING=3 width=60>
<TR>
<TD COLSPAN=3 ALIGN=center><A HREF="index.php3" target="Main"><IMG
SRC="images/btn_top.gif" BORDER=0 ALT="TOP"></A></TD>
</TR>
<?
 $sqlstr = "select * from appconf where use = 't' and cngok = 'f' order by
sort_order;" ;
 $Menu = @pg_exec($conn,$sqlstr);
 $Endd = @pg_numrows($Menu);
 $i = 0;
 while ($i < $Endd){
  if ($i%3 == 0) {
   echo "<TR>";
  }
  echo "<TD><A HREF=\"" . @pg_result($Menu, $i , "link") . "\"
target=\"Main\">";
  echo "<IMG SRC=\"images/";
  echo ereg_replace(".gif","_s.gif",pg_result($Menu,$i,"gazou"));
  echo "\" alt=\"".@pg_result($Menu,$i,"name")."\" border=0></A></TD>\n";
  $i++;
  if ($i%3 == 0) {
   echo "</TR>";
  }
 }
 if ($i%3 != 0) {
  echo "</TR>";
 }
 $admin = admchk($conn,$PHP_AUTH_USER);
 if ($admin > 0){
  $sqlstr = "select * from appconf where use = 't' and cngok = 't' order by
gwap;";
  $Menu = @pg_exec($conn,$sqlstr);
  $Endd = @pg_numrows($Menu);
  $x = 0;
  while ($x < $Endd){
   if ($x%3 == 0) {
    echo "<TR>";
   }
   echo "<TD><A HREF=\"" . @pg_result($Menu,$x,"link") . "\"
target=\"Main\">";
   echo "<IMG SRC=\"images/";
   echo ereg_replace(".gif","_s.gif",pg_result($Menu,$x,"gazou"));
   echo "\" alt=\"";
   echo @pg_result($Menu,$x,"name")."\" border=0></A>\n</TD>";
   $x++;
   $i++;
   if ($x%3 == 0) {
    echo "</TR>";
   }
  }
  if ($x%3 != 0) {
   echo "</TR>";
  }
 }
?>
<?
 @pg_FreeResult($result);
 @pg_Close($conn);
?>
</TABLE>
</CENTER>
<?
/******* テ\x90囚此屮離好轡▷▲漫▲院▷廛\xA4顥魯燹▲院◆ΑㇰΕ漫≫殴魯ぅ掘▲曄廛▲吋筺▲泪魁ΑΕ①▲蓮◆◆▲漫▲叩▲拭\xA2
オ、、。」*******
include ("include/copyright.conf")
************* "Copyright" Don't Remove!! ******************************/
?>
</BODY>
</HTML>

--------------------------------------------------- End of
menu.php3---------------

--------------------- Begining of
admchk.func --------------------------------------
<?
/************************************
admchk : エノヘ鈐轡筌咩↗灰\xB3
ー絺\x88↗\xA1arg1 = DBタワツウID
。。。。。ァarg2 = シメーハヨケ
*************************************/
function admchk($arg1,$arg2) {
 $sqlstr = "SELECT count(*) ";
 $sqlstr .= "FROM administrators ";
 $sqlstr .= "WHERE emp_cd = '$arg2';";
 $result = @pg_exec($arg1,$sqlstr);
 if (!$result) {
  return 0;
 }
 return @pg_result($result,0,"count");
}
?>

---------------------------------- End of
admchk.func ------------------------------------

------------------------------ Beginning of
gw.conf ---------------------------------------
<?
$host = "localhost";
$masterdb = "masters";
$admin = "skyboard@localhost";
$maxfilesize = 52428800;
$bgimage = "back_w.gif";
$bgtable = "#ffffff";
$menubg = "back_r.gif";
$useimode = "yes";
$authimode = "yes";
$telnotify = "yes";
$chasen = "/usr/local/bin/skycha";
$msgontop = "No";
?>

--------------------------------- end of
gw.conf -----------------------------------

Would this be not compatible to be used in PHP4.22?

If so, how can I change these codes to make compatible to PHP4.22?

I thank you very much in advance.

Abraham Lee
AMS



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORM] Upgrade to dual processor machine?
Next
From: "Henrik Steffen"
Date:
Subject: Re: [PERFORM] Upgrade to dual processor machine?