2016-12-21 69 views
-2

有人可以幫助我顯示數據嗎?我的問題是,當數據有一個符號&$_GET得到一個數據在href它不顯示。當數據沒有符號&時,顯示該數據。如何使用&字符爲GET或POST發送參數值

當標題有&符號時,數據將不會顯示。

<a href="Reserved.php?Details=<?php echo $Reserve['Title']; ?>"><button name="Details" type="button" value="Details"><i class="fa fa-info-circle"></i> Details</button></a> 
<?Php 
if(isset($_GET['Details'])){ 
       $Details = $_REQUEST['Details']; 


        $Reserve_Query = mysql_query("SELECT a.*, b.*, c.*, d.*, e.*, f.* FROM tblReserved a, tblUser b, tblResources c, tblAuthor d, tblCategory e, tblResourcesType f WHERE a.User_ID = b.User_ID AND a.Accession_No = c.Accession_No AND c.Accession_No = d.Accession_No AND c.Category_ID = e.Category_ID AND c.Type_ID = f.Type_ID AND c.Title = '$Details'"); 
        $Reserve = mysql_fetch_array($Reserve_Query); 
       ?> 
       <tr align="center" style="border: 1px solid #115a01;"> 
        <td><?php echo $Reserve['Title']; ?></td> 
        <td><?php echo $Reserve['Author']; ?></td> 
        <td><?php echo $Reserve['Category']; ?></td> 
        <td><?php echo $Reserve['Resources_Type']; ?></td> 
       </tr> 
       <tr><td colspan="4" height="5"></td></tr> 
} 
+1

我們無法幫助這種模糊的描述。您需要將您的代碼添加到問題中。謝謝。 – arkascha

+0

非常蹩腳的問題。至少提供代碼進行分析。 –

+0

好吧,先生,我會編輯它 – Bit

回答

0

試試這個功能 「進行urlencode」

//if variable :jeans&shirts 
echo $variable = urlencode($_GET['variable']); 
//out put will be jeans%26shirts 

你的代碼將

<a href="Reserved.php?Details=<?php echo urlencode($Reserve['Title']); ?>"><button name="Details" type="button" value="Details"><i class="fa fa-info-circle"></i> Details</button></a> 

//你Reserved.php爲獲得價值

<?php 
    if(isset($_GET['Details'])){ 
        echo $Details = urldecode($_REQUEST['Details']); 
     } 

    ?> 
+0

好吧,先生,我會..謝謝 – Bit

+0

有沒有必要解碼的結果。 – jeroen

+0

nothings happen sir – Bit

相關問題