Bobbo
02-07-2003, 07:57 PM
Hi, I am a little confused with this, could somebody please take a look and see if there is a glaring problem.
The case study is I want to have thumbnail images that when you click on show the real sized image on the fly' HTML pages. To make things worse it was working fine until I tried to personalise the headers and footers.
In my cgi-bin (uploaded in ASCI and Chmod755) I have 3 files, fhoto.cgi, header.ini and footer.ini. The error I get from them is;
----------------------------------------------------------------------------
" Error: 500 - Internal Server Error
Sorry, an error occurred
The error message our server generated while trying to run your script was:
malformed header from script. Bad header=<HTML>: ../cgi-bin/fhoto.cgi
In file: /cgi-bin/fhoto.cgi"
--------------------------------------------------------------------------------
The 3 files I am using read as:
FILE1.
fhoto.cgi =
#!/usr/bin/perl
# Set the default picture to load, if no query is given
$DImage = "http://www.mywebsite.com/aa.jpg";
########################################
#
# You shouldn't have to change anything below this line...
#
########################################
$TheImage = $ENV{"QUERY_STRING"};
if ($TheImage eq '') {
$TheImage = $DImage;
}
#that html code we just developed goes inbetween the code found in two files,
#header.ini and footer.ini. User's can customize the look of the calendar by editing
#top.html and bot.html.
#open header.ini and read it into memory
open( HTML, "header.ini" ) ;
$i = 0 ;
while( <HTML> ){
$header[$i] = $_ ;
$i++ ;
}
#close header.ini once it is read into memory
close( HTML ) ;
#open footer.ini and read it into memory
open( HTML, "footer.ini" ) ;
$i = 0 ;
while( <HTML> ){
$footer[$i] = $_ ;
$i++ ;
}
#close footer.ini once it is read into memory
close( HTML ) ;
#now print to stdout the information from header.ini, all the code we've developed
#in this script, and the information from footer.ini.
print <<END
@header
<TABLE border=0 width='100%'><TR><TD><CENTER>
<IMG SRC=$TheImage>
<br><br><a href='javascript:history.go(-1)' onMouseOver='self.status=document.referrer;return true'>Go Back</a><br>
</CENTER></TD></TR></TABLE>
@footer
END
FILE 2
footer.ini=
</BODY>
</HTML>
FILE 3
header.ini=
<HTML>
<HEAD>
<TITLE>Picture Album</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
Any advise would be very much appreciated
Thanks
The case study is I want to have thumbnail images that when you click on show the real sized image on the fly' HTML pages. To make things worse it was working fine until I tried to personalise the headers and footers.
In my cgi-bin (uploaded in ASCI and Chmod755) I have 3 files, fhoto.cgi, header.ini and footer.ini. The error I get from them is;
----------------------------------------------------------------------------
" Error: 500 - Internal Server Error
Sorry, an error occurred
The error message our server generated while trying to run your script was:
malformed header from script. Bad header=<HTML>: ../cgi-bin/fhoto.cgi
In file: /cgi-bin/fhoto.cgi"
--------------------------------------------------------------------------------
The 3 files I am using read as:
FILE1.
fhoto.cgi =
#!/usr/bin/perl
# Set the default picture to load, if no query is given
$DImage = "http://www.mywebsite.com/aa.jpg";
########################################
#
# You shouldn't have to change anything below this line...
#
########################################
$TheImage = $ENV{"QUERY_STRING"};
if ($TheImage eq '') {
$TheImage = $DImage;
}
#that html code we just developed goes inbetween the code found in two files,
#header.ini and footer.ini. User's can customize the look of the calendar by editing
#top.html and bot.html.
#open header.ini and read it into memory
open( HTML, "header.ini" ) ;
$i = 0 ;
while( <HTML> ){
$header[$i] = $_ ;
$i++ ;
}
#close header.ini once it is read into memory
close( HTML ) ;
#open footer.ini and read it into memory
open( HTML, "footer.ini" ) ;
$i = 0 ;
while( <HTML> ){
$footer[$i] = $_ ;
$i++ ;
}
#close footer.ini once it is read into memory
close( HTML ) ;
#now print to stdout the information from header.ini, all the code we've developed
#in this script, and the information from footer.ini.
print <<END
@header
<TABLE border=0 width='100%'><TR><TD><CENTER>
<IMG SRC=$TheImage>
<br><br><a href='javascript:history.go(-1)' onMouseOver='self.status=document.referrer;return true'>Go Back</a><br>
</CENTER></TD></TR></TABLE>
@footer
END
FILE 2
footer.ini=
</BODY>
</HTML>
FILE 3
header.ini=
<HTML>
<HEAD>
<TITLE>Picture Album</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
Any advise would be very much appreciated
Thanks