如何从html页面调用脚本? [英] How to call script from html page?

查看:201
本文介绍了如何从html页面调用脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从html页面调用php脚本?我有一个

TestPage.php,我想转换为TestPage.html - 但仍然从它调用一个php

脚本。


这就是我的TestPage.php现在的样子:


<?php

setcookie(" mycookie",time(),3600, " /");

?>

< html>

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN"

< head>

< title> TestPage.php< / title>

< / head>

< body>

这里的内容

<?php

包括''myscript。 php'';

?>


该网站托管在LAMP服务器上 - Apache 1.3.27

有吗任何方法使这个html页面仍然调用myscript.php?

Is it possible to call a php script from an html page? I have a
TestPage.php that I want to convert to TestPage.html - but still call a php
script from it.

This is how my TestPage.php looks now:

<?php
setcookie("mycookie",time(),3600,"/");
?>
<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<head>
<title>TestPage.php</title>
</head>
<body>
content here
<?php
include ''myscript.php'';
?>

The site is hosted on a LAMP server - Apache 1.3.27
Is there any way to make this an html page and still call myscript.php?

推荐答案

2004年7月17日星期六16:24:11 +0000, deko写道:
On Sat, 17 Jul 2004 16:24:11 +0000, deko wrote:
是否可以从html页面调用php脚本?我有一个
TestPage.php,我想转换为TestPage.html - 但仍然从它调用一个php
脚本。

这就是我的TestPage.php现在的样子:

<?php
setcookie(" mycookie",time(),3600," /");
?>
< html>
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN"
< head>
< title> TestPage.php< / title>
< / head>
< body>
这里的内容
<?php
包含''myscript.php'';
?> ;

该网站托管在LAMP服务器上--Apache 1.3.27
有没有办法让这个html页面仍然可以调用myscript.php?
Is it possible to call a php script from an html page? I have a
TestPage.php that I want to convert to TestPage.html - but still call a php
script from it.

This is how my TestPage.php looks now:

<?php
setcookie("mycookie",time(),3600,"/");
?>
<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<head>
<title>TestPage.php</title>
</head>
<body>
content here
<?php
include ''myscript.php'';
?>

The site is hosted on a LAMP server - Apache 1.3.27
Is there any way to make this an html page and still call myscript.php?


RewriteRule /^TestPage\.html


RewriteRule /^TestPage\.html


/TestPage.php [L]

或者如果你计划这样做全球 :

RewriteRule /^(.*)\.html
/TestPage.php [L]
Or if you plan on doing this "globally":
RewriteRule /^(.*)\.html


/


这篇关于如何从html页面调用脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆