473,663 Members | 2,705 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 2356
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********@hot mail.comkirjoit ti
viestissä:11*** *************** ****@a34g2000cw b.googlegroups. 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
2102
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 per product in the 'products' table). It is generated with the following php
1
1871
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 I dynamically pass the variables from a list, for example to the unittest module so I can maintain the list of test cases more easily: ------------------------- import DB import unittest class ConnectString(unittest.TestCase):
5
6169
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 (www.johnmacintyre.ca). The problem is that I am trying to pivot biological taxonomy information, and may end up with a table containing over 200 columns. This takes the dynamic string well over the 8000char limit for variables. >From my understanding, the...
2
1594
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 class=" & EditDivCSSClass & " id=" & Me.ID & " " & strContentEditable & " wrap>" & _strText & "</span>")
2
1746
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 emails by non technical users. It consists of the layout, dummy content, and a form that the user can enter the correct data into. Pressing the form button updates the page with the appropriate content and destroys the form. At this point i would...
1
2442
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 the case statement that causes the trouble.. i could post the whole procedure but there is no point. similar case statements as the following one exisst in the procedure that save in the same memory segment (but at dif offest) floats, Q_UINT8 and...
5
6755
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 link buttons to stay wired up to their click events. I have what is basically a simply survey question generation page. The page first displays a few static fields and a dropdownlist of various options for the user to select. When the user...
1
2268
by: johnjsforum | last post by:
Buddies, I have a web page to create HTML buttons dynamically as in the “formDivColorPicker” function //////////////////////////////////////////////////////////////////////////////////// version 1 : using global variables ////////////////////////////////////////////////////////////////// var _textField, _divColorPicker; // global vars window.onload = function() { _textField = document.getElementById('htxaMessage'); // fill...
3
2146
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 that as an html file in server itself. Please advise how i can accomplish this. Thanks for help!!
0
8435
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.