Reading in an html page and including it in cgi ?

Posted on 2003-02-24
Medium Priority
Last Modified: 2013-12-25
Hi there, I have a quick question that hopefully is an easy answer.

I am coding a database driven site using cgi / mysql, but for some of the pages I would like to create a simple html page like form.html then with my cgi code just say like

"include form.html here and display it" so in future I can simply open the html page and edit it without having to scroll through all the cgi code. I assume this is possible?

In coldfusion for example, you can just use "cfinclude template=form.html" then it would display it.

It doesnt have to be .html it could be a .txt file.

Thanks for any help in advance

Scott Wright
Question by:scottwwright
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 17

Expert Comment

ID: 8007908
open (F, "data.txt");
while(<F>) {
  print $_;

You might find HTML::Template to be more useful though.
LVL 17

Accepted Solution

dorward earned 300 total points
ID: 8007916
http://perlmonks.thepen.com/65642.html <<-- HTML::Template tutorial.

Author Comment

ID: 8007940
execellent work, just what the doctor ordered.

Thanks !
LVL 17

Expert Comment

ID: 8007987
Glad to have helped.

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question