Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to expand a scalar variable in my cgi script and can not seem to get it to work correctly. Any help would be appreciated. I have written a simple script below to demonstrate my problem:
#!/usr/bin/perl use HTML::Template; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); $|=1; print "Content-type: text/html\n\n"; print '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'."\n"; print "<html>\n"; print "<head>\n"; print "<title>TESTING</title>\n"; print "</head>\n"; print "<body>\n"; $download = "download"; $link = "http://129.107.52.101/cgi_data/result2007623204259.pdf"; print '<input type="button" value="Download PDF Report" onClick=$link, + $download); return false;">'; print "</body>\n"; print "</html>\n";
When I clicked on the download button to download the pdf file, it did not pop up a download window as I expected it to. I used the browser view source option and found out that $link and $download did not get expanded. Any thought on this?
Code tags added by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expanding Scalar Variable
by Corion (Patriarch) on Jul 24, 2007 at 07:41 UTC | |
|
Re: Expanding Scalar Variable
by FunkyMonk (Bishop) on Jul 24, 2007 at 07:46 UTC | |
by Anonymous Monk on Jul 24, 2007 at 08:07 UTC |