[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

calling DHTML to nested table within script?

Posted on 2000-05-09
4
Medium Priority
?
241 Views
Last Modified: 2013-12-25
Hi !

I have a dhtml script with image map & graphic.  It is rather lengthy. Rather that hardcode it into each of my multiple cgi scripts, I would like to keep it separate and have the cgi call it into a table cell.

Unfortunately, I am not so pro at cgi (I am editing a downloaded script) and am not sure of the best ways to (a) include the html and (b) escape or 'print' the html.

I have it defined thus:

   #Wel Map
   $welmap;
   open(FILE, "/welmap.html") || die print"please work";
   while(<FILE>){
   print "$_\n";
   }
   close (FILE);

and later called:

    <td width="125" rowspan="4" valign="top"         bgcolor="#ffffcc">$welmap</td>

This results in a 500 error. The entire welmap.html is

(1) dhtml/javascript/drill down menu;
(2) a table in and of itself;
(3) Successfully called in and used in SHTML

Nothing is escaped.  Oh yeah, and if I cut and paste the html from the welmap.html document directly into the cgi script (defining $welmap) it works fine.  So it's not something in the dhtml itself.  I just need to know how to call the .html file, and escape the html once it loads.

Is such a nested table compatible with Perl? And if so, can you *PLEASE* help me figure out how?

Thanks for your time!
0
Comment
Question by:celere
[X]
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
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 400 total points
ID: 2794297
instead of ...

#Wel Map
$welmap;
open(FILE, "/welmap.html") || die print"please work";
while(<FILE>){
print "$_\n";
}
close (FILE);

try this....

#Wel Map
undef $/;

open(FILE, "/welmap.html") || die print "please work";
## The next line reads the ENTIRE file into a variable.
$welmap=<FILE>;
close(FILE):
$/="\n";


So later when you call...


                        <td width="125" rowspan="4" valign="top"         bgcolor="#ffffcc">$welmap</td>

the $welmap variable will print the entire contents of the welmap.html file!!

0
 
LVL 6

Expert Comment

by:christopher sagayam
ID: 2795190
what is the full path to your cgi script ?

what is the full path to your "welmap.html" ?
0
 

Author Comment

by:celere
ID: 2797185
Interesting.

This works if the welmap.html file is in the same directory as the cgi script:

#Wel Map
undef $/;
open(FILE, "welmap.html")|| die print "please work";
## The next line reads the ENTIRE file into a variable.
$welmap=<FILE>;
close(FILE);
$/="\n";

But if I have the html file in the parent directory, both root relative and absolute refs fail. I can work with them in the same directory, but if anyone can enlighten me on why this is, I appreciate it.  Thanks!
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2797377
check if the user under whom the CGI process runs (typically nobody) has read access to the directory/directories in question.

that looks like the most probable cause of your problem.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

656 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