954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Call an HTML page

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

bhavna_816
Junior Poster
116 posts since Sep 2006
Reputation Points: 10
Solved Threads: 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 $_;
}
Dukane
Posting Whiz in Training
295 posts since Oct 2006
Reputation Points: 45
Solved Threads: 29
 

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;
KevinADC
Posting Shark
921 posts since Mar 2006
Reputation Points: 246
Solved Threads: 67
 

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

hsincredible
Newbie Poster
1 post since May 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You