How Perl embeds HTML

Source: Internet
Author: User
Tags html page relative resource

Q: I now have an HTML page code that wants to change it to a Perl program if simply add "#!.. in its first line /perl/bin/perl ", and change the file suffix name to. CGI, the error prompts" you don t have permission to access/test/index.cgi on the this server. " In other words: How do you include HTML code in Perl with a suffix named. cgi?

Answer: Sub html_html

{

print "content-type:text/html";

Print < #这里输出html

Eof

Exit

}

Q: After adding a sure enough, but the picture inside the "resource/top.gif" but can not show that the picture path is absolutely correct, such as: Resource/top.gif

A: With the relative path, it is best to do an installation file setup.cgi

In this file of yours:

Require "setup.cgi";

Then call this: Lt;img src= "$gif/top.gif" >

This line is in the setup.cgi file:

$gif = ' Http://your url/resource '; #图片的URL路径, note that single quotes rather than double quotes.

This should be possible with a relative path.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.