Recently, in csdn CGI, we have seen centuries (burning the sun) Users asking how to embed HTML in Perl. This is a common problem in Perl web development, hope to help you.
Question |
I now have an HTML webpage code. I want to change it to a Perl program. If I just add "#!.. /Perl/bin/Perl "and change the file suffix. CGI. The error message "You don't have permission to access/test/index appears. CGI on this server. ". In other words, how does Perl with a suffix of. cgi contain HTML code? Thank you. |
Answer: |
Sub html_html { Print "Content-Type: text/html/n "; Print <EOF; # Output html EOF Exit; } |
Question |
Thank you, ceocio. After the image is added, the image "resource/top.gif" cannot be displayed. The image path is absolutely correct, for example, resource/top.gif. |
Answer: |
Use the relative path. It is best to create an installation file setup. cgi In your file: Require "setup. cgi "; Then, call:
The setup. cgi file contains this line: $ GIF = 'HTTP: // your url/resource'; # The URL path of the image. Note that it is a single quotation mark instead of a double quotation mark. In this way, you can use the relative path. |