站点链接使用php有什么作用?
What is the function of using php for site links?
我在一个站点上工作,构建者混合使用 php 和 html 作为链接。例如:
<li><a href="variable-frequency-drives.php">Variable Speed Drives</a></li>
<li><a href="corrosion-resistant-baseplates.php">Corrosion Resistant Baseplates</a></li>
和
<li><a href="<?php echo $external_video_link?>MP_PUMP.html" target="_blank">MP Repair</a></li>
<li><a href="<?php echo $external_video_link?>MTA_PUMP.html" target="_blank">MTA Repair</a></li>
php在另一个文件中是这样引用的:
<?php
$pdf_link = "../pdf/";
$external_pdf_link = "../../pdf/";
$video_link = "../video/";
$external_video_link = "../../video/";
?>
我担心的是不知道 php 的功能,除了它是一个占位符,而且考虑到链接是双向的,我不想破坏某些东西,因为我对它一无所知目的。
在做我的尽职调查时,我 运行 穿过这个 post,它很接近,但仍然没有雪茄,Add php variable inside echo statement as href link address?. All of the research seems to be about how rather than why. This is the site, and they only used it for the "Downloads" links: http://magnatexpumps.com/
谢谢...
B
没有正确的方法。他们只是不同而已。
让我们暂时忘记 PHP。如果您在页面中有此 link:
<a href='about.html'/>About</a>
会发生什么?浏览器将更改文档的 URL。如果您位于站点的根目录,例如:"www.example.com",将重定向到 "www.example.com/about.html"。如果您在 URL 中,例如 "www.example.com/news/index.html" 会将您重定向到 "www.example.com/new/about"。这就是为什么有时之前有一个变量很有用,以强制使用完整路径 URL.
另一种 URL 变量插值的情况是当您在同一个 url 中有不同的系统 运行 时。在这种情况下,您必须附加系统名称才能到达您想要的位置。如果您不知道您的应用程序将 运行 在文档根目录或子文件夹中 运行 的位置,请使用变量来指示基本路径。
我在一个站点上工作,构建者混合使用 php 和 html 作为链接。例如:
<li><a href="variable-frequency-drives.php">Variable Speed Drives</a></li>
<li><a href="corrosion-resistant-baseplates.php">Corrosion Resistant Baseplates</a></li>
和
<li><a href="<?php echo $external_video_link?>MP_PUMP.html" target="_blank">MP Repair</a></li>
<li><a href="<?php echo $external_video_link?>MTA_PUMP.html" target="_blank">MTA Repair</a></li>
php在另一个文件中是这样引用的:
<?php
$pdf_link = "../pdf/";
$external_pdf_link = "../../pdf/";
$video_link = "../video/";
$external_video_link = "../../video/";
?>
我担心的是不知道 php 的功能,除了它是一个占位符,而且考虑到链接是双向的,我不想破坏某些东西,因为我对它一无所知目的。
在做我的尽职调查时,我 运行 穿过这个 post,它很接近,但仍然没有雪茄,Add php variable inside echo statement as href link address?. All of the research seems to be about how rather than why. This is the site, and they only used it for the "Downloads" links: http://magnatexpumps.com/
谢谢... B
没有正确的方法。他们只是不同而已。
让我们暂时忘记 PHP。如果您在页面中有此 link:
<a href='about.html'/>About</a>
会发生什么?浏览器将更改文档的 URL。如果您位于站点的根目录,例如:"www.example.com",将重定向到 "www.example.com/about.html"。如果您在 URL 中,例如 "www.example.com/news/index.html" 会将您重定向到 "www.example.com/new/about"。这就是为什么有时之前有一个变量很有用,以强制使用完整路径 URL.
另一种 URL 变量插值的情况是当您在同一个 url 中有不同的系统 运行 时。在这种情况下,您必须附加系统名称才能到达您想要的位置。如果您不知道您的应用程序将 运行 在文档根目录或子文件夹中 运行 的位置,请使用变量来指示基本路径。