Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Reading in an html page and including it in cgi ?

Posted on 2003-02-24
4
Medium Priority
?
153 Views
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
0
Comment
Question by:scottwwright
  • 3
4 Comments
 
LVL 17

Expert Comment

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

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

Accepted Solution

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

Author Comment

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

Thanks !
0
 
LVL 17

Expert Comment

by:dorward
ID: 8007987
Glad to have helped.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

579 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