You are here: Re: [PHP] create HTML page on the fly « PHP « IT news, forums, messages
Re: [PHP] create HTML page on the fly

Posted by Adrian Bruce on 10/25/05 18:39

I think you can use a different handle when using fwrite() which will
make php create a file if one is not already there: something like

if ($fp = fopen($file,"x+")){
echo"opened";
}
fwrite($fp,$content);
fclose($fp);

Ade

Angelo Zanetti wrote:

> Hi guys.
>
> I've created a small newsletter application and the content of the
> newsletter is stored in a DB (the HTML).
>
> However once the newsletter is complete and the user clicks a button I
> want the newsletter/html file to be created on the server. How do I
> go about this?
>
> I assume that I will use fwrite() to add the HTML to the file, I need
> to know how to actually create the file before adding the content to it.
>
> thanks in advance.
> Angelo
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация