求救我的脚

xmutiger 2003-10-20 03:20:28
为什么这么复杂的脚本都可以运行:
#!/usr/bin/perl
$server_script_path = "/www/users/artinternationalwholesale.net/cgi-bin/ccp5/";
$server_data_path = "/www/users/artinternationalwholesale.net/ccp5/data/";
$server_media_path = "/www/users/artinternationalwholesale.net/ccp5/media/";

$url_script_path = "http://www.artinternationalwholesale.net/cgi-bin/ccp5";
$url_media_path = "http://www.artinternationalwholesale.net/ccp5/media";

$site_script_url = "http://www.artinternationalwholesale.net/cgi-bin/ccp5/cp-app.cgi";
$site_media_url = "http://www.artinternationalwholesale.net/ccp5/media";

if ((-e "$server_script_path") && (-e "$server_data_path") && (-e "$server_media_path")) {

require "$server_script_path/library/common/initialize.pl";
$script_name = "cp-admin.cgi";
$execute_type = "adm";

if ($url_script_path ne "" && $url_media_path ne "" && $script_name ne "" && $execute_type ne "") {

&initialize;


} else {

print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Script Execution Error</TITLE></HEAD><BODY>\n";
print "<H1>Script Execution Error</H1>The following server paths are not correct:<BR><BR>\n";
if (!(-e "$server_script_path")) {print "Server Script Path \(\$server_script_path variable\)<BR>\n";}
if (!(-e "$server_data_path")) {print "Server Data Path \(\$server_data_path variable\)<BR>\n";}
if (!(-e "$server_media_path")) {print "Server Media Path \(\$server_media_path variable\)<BR>\n";}
print "</BODY></HTML>\n";

}
exit;

然而,我把它改为一个简单的程序就运行不了,大侠帮我解决以下难题了:
#!/usr/bin/perl
print "<h>hello</h>";
...全文
45 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zengh 2003-11-11
  • 打赏
  • 举报
回复
少了个print "Content-type: text/html\n\n";
xmutiger 2003-10-21
  • 打赏
  • 举报
回复
谢谢楼上的两位仁兄,原来是用笔记本打开没有显示html标签。
liu22 2003-10-20
  • 打赏
  • 举报
回复
因为客户端是浏览器,所以必须打印HTML头,如下改动:

#!/usr/bin/perl
print "Content-type: text/html\n\n"; #关键,告知浏览器是HTML代码
print "<HTML>\n"; #可无,最好有
print "<h>hello</h>";
print "</HTML>\n"; #可无,最好有

你的代码在DOS窗口中用PERL解释肯定是正常的。
xmutiger 2003-10-20
  • 打赏
  • 举报
回复
修改了,并且用了ascii上传了,运行后出现Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request
lgjut 2003-10-20
  • 打赏
  • 举报
回复
可以执行啊。
是不是没修改文件的可执行属性。

37,719

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧