显示来自另一个PHP网站的数据 [英] Display data from another php site
问题描述
我无法在另一个php网站上显示我的bookISBN.实际上,我的第一个php页面已将数据制成表格表格.现在,我想让用户单击书名并打开一个新的php页面,其中显示了书的详细信息.
I am having trouble to display my bookISBN in another php site. Actually my first php page I have tabulated the data into a table form. And now I want to let the user to click on the book title and open a new php page where it shows the books details.
这是我的第一个php页面代码:
This is my first php page code:
echo "<table width = \"1000px\" border = \"1\" cellpadding = \"1\" cellspacing=\"1\">";
echo "<tr>";
echo "<th>".'Book ISBN'."</th>";;
echo "<th>".'Book Title'."</th>";
echo "<th>".'Book Year'."</th>";
echo "<th>".'Category ID'."</th>";
echo "<th>".'Category Description'."</th>";
echo "<th>".'Book Price'."</th>";
echo "<tr>";
if($booknum >= 1 ){
echo "<div style='margin: 0 0 10px 0; font-weight: bold;'>$booknum record(s) found!</div>";
while ($row = mysqli_fetch_assoc($bookrs)) {
echo "<tr>";
echo "<td><center>" . $row['bookISBN']."</center></td>";
echo "<td><center><a href=\"bookdetails.php\">" .$row['bookTitle']. "</a></center></td>";
echo "<td><center>" . $row['bookYear']."</center></td>";
echo "<td><center>" . $row['catID']."</center></td>";
echo "<td><center>" . $row['catDesc']."</center></td>";
echo "<td><center>" . $row['bookPrice']."</center></td>";
echo "</tr>";
}
现在,我想知道如何检索书的ISBN号,以便我可以在第二个php页面中显示.如果有人可以帮助我,我将感到很高兴.
Now I want to know how to retrieve the book ISBN number so that i can display in my second php page. I would be glad if someone can help me with it.
推荐答案
echo "<td><center><a href=\"bookdetails.php?book=".$row['bookISBN']."\">" .$row['bookTitle']. "</a></center></td>";
bookdetails.php,您可以使用$_REQUEST['book']
bookdetails.php you can access with $_REQUEST['book']
这篇关于显示来自另一个PHP网站的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!