You are here: Re: Dynamically saving HTML containing PHP variables through PHP « PHP Programming Language « IT news, forums, messages
Re: Dynamically saving HTML containing PHP variables through PHP

Posted by Erwin Moller on 02/08/07 09:43

Mitesh wrote:

> I have an HTML page with references to PHP variables. This HTML is
> included from another PHP page. How can I save the HTML page
> dynamically i.e. when all the PHP variables are written into the HTML
> page.
>
> Thanx in Advance

Hi,

Probably the easiest way:
When creating the file that contains the values of PHP:

1) start outputbuffering above your page: ob_start()
2) Just output all you want, using your PHP variables to produce the output
3) At the end of the script, get the content of the buffer, and write that
to the file you want to include elsewhere.

If you have to do this for many pages (eg: all is dynamic), and have to
automate the process: have a look at CURL. Curl can call another PHP script
with POST or GET parameters given by you (eg the filename, other vars that
are used to produce the output, etc)

Hope that helps

Regards,
Erwin Moller

 

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

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