MYSQL数据可以被控制

时间:2014-04-19 15:21:53

标签: php html mysql css

我从数据库中获取数据,该过程运行良好,但数据流将无法控制。 以下是我的代码.........

<?php session_start();
include 'conn.php';
include '../includes/layouts/header.php';
$sql="SELECT * FROM signup";
$result=mysql_query($sql);
?>
    <div id="main">
        <div id="navigation" >
            <ul class="nav">
                <li><a href="selected_user.php">Manage Users</a></li>
                <li><a href="manage_users.php">Post New Anousment</a></li>
                <li><a href="message.php">Messages</a></li>
                <li><a href="setting.php">Setting</a></li>
                <li><a href="logout.php">Logout</a></li>
            </ul>
            &nbsp;
        </div>
        <div id="page">

            <h2>Admin Menu</h2>
            <p>Welcome to Admin Area</p>

            <table>
                <tr>
                    <th><strong>ID</strong></th>
                    <th><strong>FirstName</strong></th>
                    <th><strong>LastName</strong></th>
                    <th><strong>UserName</strong></th>
                    <th><strong>Email</strong></th>
                    <th><strong>Department</strong></th>
                    <th><strong>ID#</strong></th>
                    <th><strong>Phone #</strong></th>
                    <th><strong>Password</strong></th>
                    <th><strong>Address</strong></th>
                </tr>
<?php  while($rows=mysql_fetch_array($result)){?>

    <tr>
        <td><?php echo $rows['Id']; ?></td>
        <td><?php echo $rows['First_Name']; ?></td>
        <td><?php echo $rows['Last_Name']; ?></td>
        <td><?php echo $rows['Username'];?></td>
        <td><?php echo $rows['Email']; ?></td>
        <td><?php echo $rows['Department']; ?></td>
        <td><?php echo $rows['Employe_Id']; ?></td>
        <td><?php echo $rows['Phone']; ?></td>
        <td><?php echo $rows['Password']; ?></td>
        <td><?php echo $rows['Address']; ?></td>
    </tr>

<?php } ?>
            </table>
        </div>
        </div>






<?php include '../includes/layouts/footer.php' ?>

主要问题是密码字段,因为它是使用sha512加密的,因此它太长了,我想在表中显示它,所以任何人都可以告诉我该怎么做?如何控制密码字段的流程..因为它也分散了网页对齐....

1 个答案:

答案 0 :(得分:0)

为什么要显示加密密码?由于它只是单向加密,因此无论如何都不会有密码(不使用彩虹表..)。如果你真的想得到它,你可以使用substr($password, 0, NUMBER_OF_CHARACTERS_YOU_WANT_TO_SHOW)来获取加密的密码,并在悬停时用tipsy显示所有内容。

相关问题