[英]How can i display GET output of a hyperlink on another php page (that includes the php page that contains GET request)
[英]Display link as hyperlink enabled output from mysql in php page but I am getting error
如果執行此命令,則輸出正確:
echo "<a href="'.$elink.'">'.$elink.'</a>";
但是當我想以表格列格式顯示輸出時,我無法插入:
echo "<td width='200'>" <a href="'.$elink.'">'.$elink.'</a> "</td>";
or
echo "<td width='200'>" "<a href="'.$elink.'">'.$elink.'</a>" "</td>";
or
echo "<td width='200'>" '<a href="'.$elink.'">'.$elink.'</a> "</td>";
請更正語法錯誤。
echo '<td width="200">' . '<a href="'.$elink.'">'.$elink.'</a></td>';
看起來您的報價不匹配。 但是我會用sprintf。
echo sprintf("<td width='200'><a href='%1$s'>%1$s</a></td>", $elink);
首先,您的報價被弄亂了。 它們應如下所示:
echo "<td width='200'> <a href='".$elink."'>".$elink."</a></td>";
更正您的字符串格式
echo '<td width="200"><a href="'. $elink. '">' . $elink . '</a></td>';
我建議您使用屬性樣式( style="width:200px;"
)代替width屬性。 記住要對href屬性中包含的參數進行Url編碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.