[英]PHP read more link should redirect to same page or a new page
我是PHP和前端編碼的新手。 我一直在處理顯示消息行的表單。 有時這些消息往往太長,因此我使用“閱讀更多”鏈接來限制文本顯示。 該鏈接會針對每條消息顯示,但是當我單擊該鏈接時,我希望它要么將整個消息顯示在同一頁面上,要么顯示在另一頁面上。 這是獲取鏈接的代碼部分:
enter code here
//message.php
while($row = mysqli_fetch_assoc($result))
{
...
echo "<tr>";
...
echo "<td>" . $row['Subject'] . "</td>";
//------- display text with read more link ------------
$string = $row['msgText'];
if (strlen($string) > 10) {
// truncate string
$stringCut = substr($string, 0, 10);
// make sure it ends in a word...
$string = substr($stringCut, 0, strrpos($stringCut, ' '))."... <a href='single.php'>More</a>";
}
echo "<td>" . $string . "</td>";
.......
}
我希望將整個文本顯示在single.php頁面中,那么如何傳遞對該頁面的引用? 還是至少顯示在同一頁面(messages.php)中? 感謝任何幫助。 謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.