Forum Moderators: coopster & phranque

Message Too Old, No Replies

Using HTML page in script

         

dreaming of nascar

3:12 am on Apr 1, 2003 (gmt 0)

10+ Year Member



I was wondering if there is a way to use a HTML webpage in your script.
For example:
script stuff
.
.
.
then here I want to print out the contents of an HTML
page.
.
.
.
.
more script stuff

I know that I can copy/paste the HTML code into the script, but I was wondering if I could just call the HTML page to display. It sure would make editing easier. I hope that this makes sense. Thanks!

D O N

marcs

3:20 am on Apr 1, 2003 (gmt 0)

10+ Year Member



I know that I can copy/paste the HTML code into the script, but I was wondering if I could just call the HTML page to display. It sure would make editing easier.

You could write a routine in the script which reads a .html file and outputs it. Then simple call that routine and feed it the name/path of the html file to output whenever you need it.

As to what exactly that routine would look like, that depends on the language the script is created in.

jatar_k

3:25 am on Apr 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could also just use include [php.net] if it will work in its present format.

this thread might provide some insight on working with include
includes and directories [webmasterworld.com]

dreaming of nascar

4:36 am on Apr 1, 2003 (gmt 0)

10+ Year Member



I am trying to do this in PERL.

I would like to have example.html loaded on my server and when I wanted it to be displayed I would rather have a script call the .html file then to have to copy/paste the HTML code into the script itself. Any suggestions/ code fragments on how this could be accomplished would be apprecaited. I think the include statement would work just as I want, if only I was using PHP.

Thanks

D O N

jatar_k

4:43 am on Apr 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



alright then, what about this
having include problems [webmasterworld.com]

[edited by: jatar_k at 5:06 am (utc) on April 1, 2003]

msr986

5:02 am on Apr 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, here:

open (HTML, "example.html");
while (<HTML>) {
print $_;
}
close (HTML);

At WebmasterWorld we love to help out a person who is stuck on a problem.

Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime!