[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] safe_mode php do not seems to behave correctly



I forgoten to give some more infos about packaging:

PHP version:  4.3.1 (solarspeed package)
------------

Index.php rewroten with no include for making it more simple:
-------------------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>No title</title>
  <meta name="generator" content="amaya 7.2, see http://www.w3.org/Amaya/";>
</head>

<body>
<h1>fopen test under safe_mode php</h1>
<?
        $paramFile="action_params3.txt";

        if (!$paramFileFd=fopen($paramFile, "r")) {
           echo ("<br><br>Error: Can't open requested file.<br><br>");
        } else {
           while (!feof ($paramFileFd)) {
             $paramLine = trim( fgets($paramFileFd,1024) );
             if ( strlen( $paramLine ) == 0 || ereg("^#.*$",  $paramLine ) ) {
                  continue; // this removes any empty or "#" begining lines
             } else {
list($myFirst,$mySecond,$myThird,$myFourth)=explode(" ",$paramLine); break; // we've got the unique usefull line and set our vars, so we breaks here
              }
            }
            fclose( $paramFileFd );

            echo ( "<p>Values contained in external text file:</p>" );
            echo ( "<p>myFirst = $myFirst <br>" );
            echo ( "mySecond = $mySecond <br>" );
            echo ( "myThird = $myThird <br>" );
            echo ( "myFourth = $myFourth <br></p>" );
        }

?>
<p>
</p>
</body>
</html>