Thread: php3 compatibility?

php3 compatibility?

From
アムス
Date:
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



Re: OT: php3 compatibility?

From
Robert Treat
Date:
IIRC the way that includes are handled changed between php3 and php4.
Look in your php.ini it should have a setting like include directory;
make sure its not causing some weird issues.

If that doesn't root out the problem, I'd suggest posting any actual
error messages your receiving to php related list.

Robert Treat

On Thu, 2002-11-14 at 15:31, アムス wrote:
> 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>
> <?
> /******* テ??「ノスシィ、ヌ、ケ。」イ?ハム、ケ、・・遉ヌ、箍ハイシ、ホ」アケヤ、マコ・・キ、ハ、、、ヌ、ッ、タ、
> オ、、。」*******
> include ("include/copyright.conf")
> ************* "Copyright" Don't Remove!! ******************************/
> ?>
> </BODY>
> </HTML>
>
> --------------------------------------------------- End of
> menu.php3---------------
>
> --------------------- Begining of
> admchk.func --------------------------------------
> <?
> /************************************
> admchk : エノヘ?シヤク。ココ
> ー??ァarg1 = 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
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)