本文整理汇总了PHP中sql::status方法的典型用法代码示例。如果您正苦于以下问题:PHP sql::status方法的具体用法?PHP sql::status怎么用?PHP sql::status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sql
的用法示例。
在下文中一共展示了sql::status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sql
#Profileinf #infcontainer #right{
width: 250px;
float:right;
text-align:center;
}
</style>
<?php
error_reporting(E_ALL);
if (!isset($sql)) {
require 'sql.class.php';
$sql = new sql();
$imgs = '../imgs/';
} else {
$imgs = '/imgs/';
}
if (isset($_COOKIE['username']) && isset($_COOKIE['password']) && $sql->status() == 1) {
//echo "Account details:<br><br>";
$sth = $sql->dbh->prepare("SELECT * FROM `" . $sql->tbl['users'] . "` WHERE username = :username");
$sth->bindParam('username', $_COOKIE['username']);
$sth->execute();
if ($row = $sth->fetch()) {
echo "<div id='Profileinf'>";
echo "<img src='" . $imgs . "Def_ProfilePic.png' style='width:250px;border-radius:125px;' />";
/*echo "First name: ".$row['first_name']."<br>";
echo "Last name: ".$row['last_name']."<br>";*/
echo "<div id='infcontainer'><div id='top'>";
echo "" . $_COOKIE['username'] . "<br>";
echo "</div><div id='left'>";
echo "Email: " . $row['email'] . "<br>";
echo "Registered: " . date("d. \\of F Y", $row['timestamp']) . "<br>";
$comsent = $sql->dbh->query("SELECT COUNT(*) FROM `" . $sql->tbl['comments'] . "` WHERE `user_id` = '" . $row['id'] . "'")->fetchAll()[0][0];
示例2:
$col = 'lime';
} else {
$col = 'red';
}
echo '<div class="notificationleft" style="float:left;">' . $title . ' - ' . $content . '</div><div style="width:50px;height:50px;border-radius:25px;background-color:' . $col . ';float:right;"></div>';
}
?>
</div>
</div>
<div id="gradient"></div>
<?php
echo '<div id="DivHeader"><img src="imgs/YC1.png" style="height:40px;" /><div id="menuitems">';
foreach ($pages as $page) {
echo '<a data-href="' . array_search($page, $pages) . '" class="noselect">' . $page . '</a>';
if (array_search($page, $pages) == 'profile') {
if ($sql->status()) {
$str = 'Hello ' . $_COOKIE['username'] . '<br><a href="m/verify.php?type=logout">Logout</a>';
} else {
$str = 'You are not logged in.<br><a id="loginbutton">Login</a> or <a id="registerbutton">register</a>';
}
echo '<div class="dropdown" style="display:none;"><div id="arrow"></div><div id="main">' . $str . '</div></div>';
} else {
if (isset($dropdowns[array_search($page, $pages)])) {
echo '<div class="dropdown" style="display:none;"><div id="arrow"></div><div id="main">' . $dropdowns[array_search($page, $pages)] . '</div></div>';
}
}
}
echo '</div></div>';
?>
<div id="login" style="display:none;overflow-y:hidden;">