簡體   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