2010-03-03 47 views
1

獲取值,我想在這樣的一個網址設定值:如何設置,並從URL

<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'&note='$id_note'&user='$username'> 

然後能夠從recieving頁面再搶。

現在所有即時得到是這樣的點擊時:

http://localhost/readnotes/viewyournote.php?chapter= 

回答

2

我不如何​​嵌入您的鏈接在你的代碼,但如果它是<?php ?>外標籤,然後你要做的:

<a href="http://<?php echo $data_url ?>/viewyournote.php?chapter=<?php echo $name_of_chapter ?>&note=<?php echo $id_note ?>&user=<?php echo $username?>" > 

如果這些標籤裏面,你也可以這樣做:

echo "<a href='http://$data_url/viewyournote.php?chapter=$name_of_chapter&note=$id_note&user=$username?' >"; 

你可以用的recieveing頁面上獲取這些值,例如$_GET['chapter']

1
<a href='http://$data_url/viewyournote.php?chapter=<?php echo $name_of_chapter; ?>&note=<?php echo $id_note; ?>&user=<?php echo $username; ?>> 
1

<?php 
echo "<a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'&note='$id_note' user='$username'>"; 
?> 

更換你的線在接收端使用

<?php 
$name_of_chapter = $_GET['chapter']; 
... 
?>