Re: using php to generate html file?

From: Date: Tue, 06 Mar 2001 17:37:02 +0000
Subject: Re: using php to generate html file?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7142@lists.php.net to get a copy of this message
<?
        /*
        ** open file for writing
        */
        $filename = "data.txt";
        if(!($myFile = fopen($filename, "w")))
        {
                print("Error: ");
                print("'$filename' could not be created\n");
                exit;
        }
        //write some lines to the file
        fputs($myFile, "Save this line for later\n");
        fputs($myFile, "Save this line too\n");
        //close the file
        fclose($myFile);
        /*
        ** open file for reading
        */
        if(!($myFile = fopen($filename, "r")))
        {
                print("Error:");
                print("'$filename' could not be read\n");
                exit;
        }
        while(!feof($myFile))
        {
                //read a line from the file
                $myLine = fgets($myFile, 255);
                print("$myLine <BR>\n");
        }
        //close the file
        fclose($myFile);
?> At 12:27 PM 3/6/01 -0500, Jaxon wrote:
Any examples on this? regards, jaxon On 3/6/01 11:39 AM, "Rick St Jean" <rstjean@internet.look.ca> wrote: I would use the the php to write to a CSS include. That way you have the tightest control over elements and design. Rick At 12:12 AM 3/7/01 +0800, you wrote:
Does any body know how to use php to generate html file? That is when
a user
input for a webpage title, webpage background color or image in a php
page,
and then we can generate a html file which contains the properties of
user's
input such as background color. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
########################################################## # Rick St Jean, # rstjean@internet.look.ca # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ########################################################## -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
########################################################## # Rick St Jean, # rstjean@internet.look.ca # President of Design Shark, # http://www.designshark.com/ # Quick Contact: http://www.designshark.com/messaging.ihtml # Tel: 905-684-2952 ##########################################################

« previous php.db (#7142) next »