獲取值,我想在這樣的一個網址設定值:如何設置,並從URL
<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'¬e='$id_note'&user='$username'>
然後能夠從recieving頁面再搶。
現在所有即時得到是這樣的點擊時:
http://localhost/readnotes/viewyournote.php?chapter=
獲取值,我想在這樣的一個網址設定值:如何設置,並從URL
<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'¬e='$id_note'&user='$username'>
然後能夠從recieving頁面再搶。
現在所有即時得到是這樣的點擊時:
http://localhost/readnotes/viewyournote.php?chapter=
我不如何嵌入您的鏈接在你的代碼,但如果它是<?php ?>
外標籤,然後你要做的:
<a href="http://<?php echo $data_url ?>/viewyournote.php?chapter=<?php echo $name_of_chapter ?>¬e=<?php echo $id_note ?>&user=<?php echo $username?>" >
如果這些標籤裏面,你也可以這樣做:
echo "<a href='http://$data_url/viewyournote.php?chapter=$name_of_chapter¬e=$id_note&user=$username?' >";
你可以用的recieveing頁面上獲取這些值,例如$_GET['chapter']
。
使用查詢字符串
$ VAL = 「yourvalue」;
$ url「http://localhost/readnotes/viewyournote.php?chapter= $ val」;
現在$ val傳遞給指定的URL。
在那裏,你可以用得到它$ _GET [「章」],它會給你「yourvalue」
<a href='http://$data_url/viewyournote.php?chapter=<?php echo $name_of_chapter; ?>¬e=<?php echo $id_note; ?>&user=<?php echo $username; ?>>
與
<?php
echo "<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'¬e='$id_note' user='$username'>";
?>
更換你的線在接收端使用
<?php
$name_of_chapter = $_GET['chapter'];
...
?>