繁体   English   中英

如何在我的 html 文件中添加 a.php 链接

[英]How can i add a .php link in my html file

Basically i have a php script that i use to log requests on my website.(ip/browser, etc) which is log.php, how can i include the log.php in my index.html so every time someone visits my website they也得到“记录”? 我已经尝试了几件事,但它的方式比我想做的要好。 基本上我想在我的主页上包含 domain.com/log.php ..

到目前为止我尝试了很多东西,但没有任何效果,我认为它真的很简单,但我无法让它工作。 非常感谢任何帮助。

对不起我的英语不好,不是我的第一语言。 我希望你能明白我的意思。

include 语句获取指定文件中存在的所有文本/代码/标记,并将其复制到使用 include 语句的文件中。

这是一个例子:

<HTML>
<head></head>
<body>

<h1>Welcome to this page!</h1>
<p>Some text.</p>
<?php include ('footer.php'); ?>

</body>
</html>

You can really execute a php code in a html file, what you can do is create a php file called index.php from there create add your code 'logging' code and then render the content of your page.

示例index.php

<?php

 // your code for logging the request 

  echo <html>...</html>

?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM