php - href 中包含 php 变量,没有打开正确的位置
问题描述
我有以下<td>
带有<a>
标签的标签,其中包含 href 中的 php 变量。我只能浏览到上传文件夹。有谁知道为什么?它应该浏览到uploads\$_POST['searchInput']
. 但它没有这样做。
<td class="viewEditTd"><button class = "btn btn-info viewEditButton"><a href="file://///172.xx.xx.xxx\TEMP\xxx\uploads\"<?php echo $_POST['searchInput']; ?>"\" target="_blank"><span class="
glyphicon glyphicon-folder-open" aria-hidden="true"></span> View File</a></button></td>
解决方案
我能够在 Stack Overflow 论坛成员的帮助下解决这个问题。就这样解决了。我的问题如下
<td class="viewEditTd"><button class = "btn btn-info viewEditButton"><a href="file://///172.xx.xx.xxx\TEMP\xxx\uploads\"<?php echo $_POST['searchInput']; ?>"\" target="_blank"><span class="
glyphicon glyphicon-folder-open" aria-hidden="true"></span> View File</a></button></td>
它是通过删除php
标签周围的两个双引号来解决的。工作答案是
<td class="viewEditTd"><button class = "btn btn-info viewEditButton"><a href="file://///172.xx.xx.xxx\TEMP\xxx\uploads\<?php echo $_POST['searchInput']; ?>" target="_blank"><span class="
glyphicon glyphicon-folder-open" aria-hidden="true"></span> View File</a></button></td>
推荐阅读
- sql - 根据条件创建新行 - Oracle SQL
- javascript - 从依赖注入中解耦包
- deep-learning - 我如何将训练数据发送到执行命令的节点
- java - 了解 Java 中 processbuilder 的示例代码
- ruby-on-rails - 管理员无法使用 CanCan 为自己创建项目?
- java - 如何在不为每一列创建新的 CellFactory 的情况下为 TableView 中的所有单元格添加 EventHandler?
- c# - 为什么我的 Base 10 LSD 基数排序比位移基数排序快?
- npm - 对于内容示例,npm install gatsby 在 WSL 中失败
- java - HBase:Zookeeper 为远程客户端提供内部 IP(Java API)
- arrays - 大会 x86 - 比较数组值需要帮助(冒泡排序)