查看下一页

时间:2016-06-19 13:06:28

标签: php variables view

这里的正确人员是我的大屁股问题,我只是一个乞丐和所有这一切,所以它可能只是一个愚蠢而简单的事情,但是如何从这段代码

<?php
session_start();
if(!isset($_SESSION['password']))
{
    header('Location:index.php');
    exit();
if ($_SESSION['logged_in']= 0)
{
    header('Location:index.php');
    exit();
}
}
?>
<?php include 'includes/header.php';?>

<div class="page_menu_box">
    <ul>
        <li><a href="userprofile.php">USER PROFILE</a></li>
        <li><a href="aboutus.php">ABOUT US</a></li>
    </ul>
</div>


<div class="page_content">
<table class="viewbook_table">
<tr>
<th>ISBN</th>
<th>AUTHOR</th>
<th>DATE WHEN PUBLISHED</th>
<th>COVER</th>
</tr>






<?php

include("core/database/connect.php");

$connection = @new mysqli('localhost','root','','bs_admin_tools');
$sql = "SELECT * FROM books";
$query = $connection->query( $sql );


while ($row = mysqli_fetch_array($query))
{
    echo "<tr>";
    echo "<td width = 15%>";
    echo $row['ISBN'];  
    echo "</td>";
    echo "<td width = 15%>";
    echo $row['author']; 
    echo "</td>";
    echo "<td width = 15%>";
    echo $row['datepublished']; 
    echo "</td>";


    //check whether an image is available for the record chosen
    if ( $row['imgdir'] )
    {
    //create a variable which holds data from the images folder
        $imageDir = "image/";
    //create a second variable which holds the value of the image   linked to the record selected
        $img = $imageDir . $row['imgdir'];
    /*link to the directory*/
        echo "<td width ='15%' padding='30%'>";
    //display the image
        echo "<left><a href='viewdetails'><img src='$img'></a>";
        echo "</td></tr>";

    }
    //echo "<br />"; //display a line break

  }//end of the while loop
//release connection from database
mysqli_close($connection);
?>
</table>

</div>


<?php
echo "<div class='page_menu_box'><ul><li>
 ".$_SESSION['login']."
</ul></li></div>'";
 include 'includes/footer.php';?> 

我只想基本点击$ img并查看书籍详细信息,换句话说,我将其中一个变量变成一个超链接,每当有人被转移到另一个页面时,我想要一个变量被发送到那个文件我会方便文件引入变量,并使用&#39;从书中选择$ theVariable =&#34; XD&#34;&#39;来显示关于该书的其他狗屎。如果有人能帮助我,我会非常高兴,我会在第二天在墙上蹦蹦跳跳。

我只能在php上做一些事情所以请解决方案只涉及php或html; _;

0 个答案:

没有答案