473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically saving HTML containing PHP variables through PHP

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

Feb 8 '07 #1
2 2349
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
Feb 8 '07 #2

"Mitesh" <oo********@hotmail.comkirjoitti
viestissä:11**********************@a34g2000cwb.goo glegroups.com...
>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.
Do You mean that you want to "store" the whole html-output of your script
into another file?

Use output buffering:
http://www.php.net/manual/en/ref.outcontrol.php

Buffer everything, then copy the whole buffer to a file and then send actual
page(buffer content) to client.

Feb 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2094
by: Dave Nouwens | last post by:
Hi All, Please accept my appologies in advance for what I expect will be a reasonably simple question. I have an html form (which is generated in php) which contains a number of rows (one row...
1
1861
by: Tom Haddon | last post by:
Hi Folks, Newbie question here. I'm trying to set up some unit testing for a database abstraction class, and the first thing I want to test is the connection parameters. So, my question is, how do...
5
6161
by: tim.pascoe | last post by:
I'm attempting to modify some Crosstab generating code, and I need some advice/examples. Currently, the code uses a single string variable to store the dynamically generated query...
2
1587
by: Web Team | last post by:
Hi All, I'm in the process of writing a eich text editor web custom control. The actual text/HTML is displayed/editied in a DIV layer, which I have created like this: output.Write("<span...
2
1741
by: mosaic.com | last post by:
I don't know who to go with for this question, googling is not very helpful, if anyone has an idea i would appreciate it. The issue: I created a page that will be used as a template for HTML...
1
2425
by: nass | last post by:
hello everyone.. i am not sure what is wrong - never liked strings anyway! my problem is that i am trying to save a QCstring in a shared memory segment and i get a segmentation fault.. here is...
5
6743
by: Amoril | last post by:
I've read quite a few different message on various boards and for some reason I'm still having trouble wrapping my head around this viewstate maintenance and trying to get these dynamically created...
1
2251
by: johnjsforum | last post by:
Buddies, I have a web page to create HTML buttons dynamically as in the “formDivColorPicker” function ////////////////////////////////////////////////////////////////////////////////////...
3
2136
by: ajaycfd | last post by:
hi all, I need to implement the following functionality in asp. I have got an asp page which renders some html onto the browser.Now instead of rendering the html to the browser i should save...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4705
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.