I am trying to write a script that pulls data from a data base and then
writes the script to be run again by php. I have added a sample below. There
is a lot more to this script but in general  what it does is set up new
sites on a server. Would it be better to have it write the code one time and
save it as a php file or write it on the fly. I hope you understand what I
am asking.The
script that it writes will be run by cron as root using php as a cgi not
attached to the web server.

$query = "SELECT
pid,plan,quota,maxusers,shell,cgi,ssi,ssl,anonymousftp,bandwith FROM plans";
$result=mysql_db_query($dbName,$query);
while ($row = mysql_fetch_array($result)) {
$pid=$row["pid"] ;
$plan=$row["plan"]  ;
$quot=$row["quota"] ;
$maxusers=$row["maxusers"];

 echo "if (\$package == 'Pack$pid') //$plan";
 echo "<br>";
      echo  "{";
          echo "<br>";
      echo   "\$quota = \"$quot\";";
          echo "<br>";
   echo "\$nuser= \"$maxusers\";";
   echo "<br>";
                echo  "\$baseip=&ip();";
                  echo "<br>";
   echo "}";
   echo "<br>";

}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to