1,105,232 Community Members

Call an HTML page

Member Avatar
bhavna_816
Junior Poster
116 posts since Sep 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

When we click on the Hyperlink of subject a new HTML Page should be pop up and shows the body of the mail.
I have written two perl codes first is for displaying the page with folders with subject another perl code having function to show the body.How can I integrate them so tht first code which is having hyperlink on subject directly goes to the HTML page which shows body of the mail i.e. another perl code which is having function to display this.

Thanks

Member Avatar
Dukane
Posting Whiz in Training
284 posts since Oct 2006
Reputation Points: 25 [?]
Q&As Helped to Solve: 29 [?]
Skill Endorsements: 0 [?]
 
0
 

You could open the HTML file, read it into an array, then line for line print it back to the browser.

For example:

open (HTMLDOC, "<../path/to/your/file.htm");
flock (HTMLDOC, 1);
my @htmlFile = <HTMLDOC>;
close (HTMLDOC);

print "Content-type: text/html\n\n";
foreach (@htmlFile) {
print $_;
}
Question Answered as of 7 Years Ago by Dukane
Member Avatar
KevinADC
Practically a Posting Shark
898 posts since Mar 2006
Reputation Points: 192 [?]
Q&As Helped to Solve: 68 [?]
Skill Endorsements: 0 [?]
 
0
 

alternatives that do the same thing:

print directly from file:

print "Content-type: text/html\n\n";
open (HTML, "<../path/to/your/file.htm");
print <HTML>;
close (HTML);

use a scalar instead of an array (slurp mode)

print "Content-type: text/html\n\n";
open (HTML, "<../path/to/your/file.htm");
my $html = do {local $/; <HTML>}; 
close (HTML);
print $html;
Member Avatar
hsincredible
Newbie Poster
1 post since May 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Can javascript be included in the above form of display?
I don't see my js functioning in my case.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article