在 php 代码中包含 html 标签,专门处理 php 块内的 href 函数

一旦满足条件,就输入 html 代码,但我的目标是同时使用 php 值和 html 标签。


尝试了标签等,并在运行中获得了大部分内容,但无法处理 href 因为它引用了某些值。不确定在哪里使用 "" 或 ``。


<?php.....        

echo `<a href="limitdatabase.php?Dropdown=.$_GET[Dropdown].;&search= $search_name;&wise=$_GET[wise];">Yes</a>`;


?> 

“是”应该用作超链接,但目前未处理 php 值,这就是为什么没有结果。


噜噜哒
浏览 181回答 2
2回答

POPMUISE

您使用的连接不正确。每当您想添加任何PHP变量时,您都需要关闭大括号并需要在PHP变量之后开始,如下所示:<?php&nbsp;echo '<a href="limitdatabase.php?Dropdown='.$_GET['Dropdown'].'&search= '.$search_name.'&wise='.$_GET['wise'].'">Yes</a>';?>此外,您应该将Dropdown和wise括在大括号中,因为它不会像您使用的那样直接在 get 中工作。希望对你有帮助!

肥皂起泡泡

您使用了错误的引号序列<?php&nbsp; ...?><?php&nbsp; echo '<a href="limitdatabase.php?Dropdown=' .&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$_GET['Dropdown'].&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;';&search='.&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$search_name .&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;';&wise='.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$_GET['wise'].&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;';">Yes</a>';?>并且您应该对字符串使用单引号而不是反引号
打开App,查看更多内容
随时随地看视频慕课网APP