Help would be appreciated
| From: | Richard Kurth | Date: | Thu, 05 Apr 2001 07:35:29 +0000 |
| Subject: | Help would be appreciated | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-47195@lists.php.net to get a copy of this message | ||
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>";
}