本文整理汇总了PHP中db::c方法的典型用法代码示例。如果您正苦于以下问题:PHP db::c方法的具体用法?PHP db::c怎么用?PHP db::c使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db
的用法示例。
在下文中一共展示了db::c方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login2
function login2($user, $pass)
{
$con = new db();
$conc = $con->c();
$kcook = intval($_POST["remember"]);
$q = mysqli_query($conc, "SELECT `id`,`user`,`name`,`email`,`img1`,`img2`,`img3`,`bgcolor` FROM `users` WHERE (`user` = '{$user}' OR `email` ='{$user}') AND pass = '{$pass}'");
if (mysqli_num_rows($q) == 1) {
$r = mysqli_fetch_array($q);
setcookie("u", $r[1], time() + 52 * 60 * 60 * 24 * 7, "/");
$_SESSION["uid"] = $r[0];
$_SESSION["user"] = $r[1];
$_SESSION["name"] = $r[2];
$_SESSION["email"] = $r[3];
$_SESSION["p"] = $pass;
$_SESSION["color"] = $r[7];
$_SESSION["img1"] = $r[4];
$_SESSION["img2"] = $r[5];
$_SESSION["img3"] = $r[6];
$_SESSION["ula"] = md5("{$r['1']} {$pass} {$r['0']}");
$con->close_db_con($conc);
if (!valid_name($_SESSION["user"])) {
$_SESSION["set_user"] = "Please correct your username remove symbols, characters or spaces, and should be less than 20 characters";
header("location: ./?settings");
} else {
if ($kcook == 1) {
setcookie("um", $r[1], time() + 52 * 60 * 60 * 24 * 7, "/");
setcookie("pm", $pass, time() + 52 * 60 * 60 * 24 * 7, "/");
}
return true;
}
} else {
return false;
}
}
示例2: login
function login($user, $pass)
{
$con = new db();
$conc = $con->c();
$kcook = intval($_POST["remember"]);
$q = mysqli_query($conc, "SELECT `id`,`user`,`name`,`email`,`img1`,`img2`,`img3`,`bgcolor` FROM `users` WHERE (`user` = '{$user}' OR `email` ='{$user}') AND pass = '{$pass}'");
if (mysqli_num_rows($q) == 1) {
$r = mysqli_fetch_array($q);
setcookie("u", $r[1], time() + 52 * 60 * 60 * 24 * 7);
$_SESSION["uid"] = $r[0];
$_SESSION["user"] = $r[1];
$_SESSION["name"] = $r[2];
$_SESSION["email"] = $r[3];
$_SESSION["p"] = $pass;
$_SESSION["color"] = $r[7];
$_SESSION["img1"] = $r[4];
$_SESSION["img2"] = $r[5];
$_SESSION["img3"] = $r[6];
$_SESSION["ula"] = md5("{$r['1']} {$pass} {$r['0']}");
$con->close_db_con($conc);
if ($kcook == 1) {
setcookie("u", $r[1], time() + 2 * 60 * 60 * 24 * 7);
setcookie("p", $pass, time() + 2 * 60 * 60 * 24 * 7);
}
return true;
} else {
return false;
}
}
示例3: PDO
function __construct($server, $user, $pw, $db)
{
try {
db::$c = new PDO("mysql:host={$server};dbname={$db}", $user, $pw);
db::$c->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//echo "connection is perfect ";
} catch (PDOException $e) {
echo $e->getMessage();
}
}
示例4: getVid
function getVid($id)
{
$con = new db();
$conc = $con->c();
$q = mysqli_query($conc, "SELECT videos.id,videos.user,videos.name,videos.info,videos.pict,videos.vid,videos.dl,videos.date,users.user FROM `videos` INNER JOIN users ON users.id = videos.user WHERE videos.id = {$id} ");
if (mysqli_num_rows($q) == 0) {
echo "({status:false,msg:'Sorry, this video cannot be found'})";
//echo "<div class='m_s_g'>Sorry, this video cannot be found.</div>";
} else {
$n = 0;
$r = mysqli_fetch_array($q);
echo "({status:true,type:3,class:'vid_prev',title:'{$r['3']}',uid:'{$r['1']}',owner:'{$r['8']}',vid:'{$r['0']}',video:'{$r['5']}',prev:'{$r['4']}',vname:'{$r['2']}',vdate:'" . gtime($r[7]) . "'})";
//echo"<table><tr>";
//echo "<a href='#!/video=$r[0]'><div style='background:url(".PTH."/img/load/ml.gif) no-repeat center;' ><div vid='$r[0]' style='background:url(".PTH."/prev/$r[4]) no-repeat center;' class='vid_prev' title='$r[3]' onclick='playvideo(event);$(\"#pwindow\").fadeOut(500);' prev='$r[4]' video='$r[5]' info='$r[3]' vidname='$r[2]' vdate='".gtime($r[7])."' owner='$r[8]' uid='$r[1]'>$r[2]<br/>$r[3]</div></div></a>";
}
$con->close_db_con($conc);
exit;
}
示例5: getVid
function getVid($uid)
{
$con = new db();
$conc = $con->c();
$q = mysqli_query($conc, "SELECT videos.id,videos.user,videos.name,videos.info,videos.pict,videos.vid,videos.dl,videos.date,users.user FROM `videos` INNER JOIN users ON users.id = videos.user WHERE videos.user = {$uid} ");
if (mysqli_num_rows($q) == 0) {
echo "<div class='m_s_g'>No content has been added yet</div>";
}
$n = 0;
echo "<table><tr>";
while ($r = mysqli_fetch_array($q)) {
$n++;
echo "<td ><a href='./video-{$r['0']}' onclick='return setURI(\"video\",{$r['0']})' ><div style='background:url(" . PTH . "/img/load/ml.gif) no-repeat center;height:120px;width:120px;padding:10px;'><div style='background:url(" . PTH . "/prev/{$r['4']}) left;' class='vid_prev' title='{$r['3']}' onclick='playvideo(event)' prev='{$r['4']}' vid='{$r['0']}' video='{$r['5']}' info='{$r['3']}' owner='{$r['8']}' uid='{$uid}' vidname='{$r['2']}' vdate='" . gtime($r[7]) . "'>{$r['2']}<br/>{$r['3']}</div></div></a><br/></td>";
echo $n % 4 == 0 ? "</tr><tr>" : "";
}
echo "</tr></table>";
$con->close_db_con($conc);
exit;
}
示例6: post
function post($id, $uid, $userid, $user, $name, $img, $date, $post, $var, $rid, $type, $client)
{
$rp = "";
if ($type == 1) {
$con = new db();
$conc = $con->c();
$q = mysqli_query($conc, "SELECT `post`.`id`,`users`.`user` FROM `post` INNER JOIN `users` ON (`users`.`id` = `post`.`user`) WHERE `post`.`id` = {$rid} ");
$r = mysqli_fetch_array($q);
$pid = $r[1];
$rp = "<a href='#' class='del' onclick='return _op({$rid},{$type})' >in reply to {$pid}</a>";
$con->close_db_con($conc);
} else {
if ($type == 2) {
$con = new db();
$conc = $con->c();
$q = mysqli_query($conc, "SELECT `post`.`id`,`users`.`user` FROM `post` INNER JOIN `users` ON (`users`.`id` = `post`.`user`) WHERE `post`.`id` = {$rid} ");
$r = mysqli_fetch_array($q);
$pid = $r[1];
$con->close_db_con($conc);
$rp = "<a href='#pwindow' class='del' name='modal' onclick='return _op({$rid},{$type})' >rePosted From {$pid} </a>";
}
}
$del = $uid == $userid ? "·<a href='#' onclick='return _del(event,\"{$id}\")'><span class='del'>delete</span></a>" : "";
if ($_SESSION["uid"] != 0) {
$reply = "·<a href='#' class='del' onclick='return _reply(event)' rid='{$id}' u='{$user}'> reply</a>";
$repost = "·<a href='#' class='del' onclick='return _repost(event)' rid='{$id}' u='{$user}'> repost</a>";
}
return "<div class='post' id='post{$id}'>\n\t\t\t\t\t<table><tr><td><a href='../home?i={$userid}' onclick='return _o(event,{$userid})' ><div class='smpdiv' style='background:url({$img}) center no-repeat'></div></a></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t<table><tr><td><a href='../home?i={$userid}' onclick='return _o(event,{$userid})' onmouseover='_pop(event,{$userid});' >{$user}</a> <i style='_pn'>{$name}</i><br/><span class='_post'>{$post}</span><br/>{$rp} <a href='#' target='_blank' class='del'>via {$client}</a> <a class='del' href='#?post={$id}' onclick='return _op({$id},0);'>" . gtime($date) . "</a><Br/>{$del} {$reply} {$repost}</td></tr></table>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t\t </div> {$var}";
}
示例7: header
session_start();
if ($_SESSION['login'] != true) {
header("Location: index.php?message=Log in.");
} else {
require 'inc/loader.php';
include "inc/funkcije.php";
require 'inc/views/template_head_start.php';
require 'inc/views/template_head_end.php';
require 'inc/views/base_head.php';
?>
<?php
//Treba mi id stranice koja se menja, BIO = 1, GALLERY = 2, CONTACT = 3
$id_page = 1;
$DB = new db();
$SQL = "SELECT * FROM pages WHERE id_page='" . $DB->c($id_page) . "'";
$DB->query($SQL);
$row = $DB->fetch_assoc();
$content = $row['content'];
$DB->close();
?>
<!-- Page Header -->
<div class="content bg-gray-lighter">
<div class="row items-push">
<div class="col-sm-7">
<h1 class="page-heading">
Content <small>change BIO text.</small>
</h1>
</div>
<div class="col-sm-5 text-right hidden-xs">
<ol class="breadcrumb push-10-t">
示例8: exit
<?php
session_start();
include "../scripts/db.php";
$style = "style='font:20px verdana;text-align:center;color:#777;'";
$user = $_SESSION["uid"];
if (!isset($_SESSION["user"], $_SESSION["p"]) && $user != 0) {
exit("<div class='m_s_g'>Invalid Authentication<div>");
}
$con = new db();
$conc = $con->c();
if (isset($_POST["del"])) {
list($id, $vid, $img) = explode("____", $_POST["vars"]);
$q = mysqli_query($conc, "DELETE FROM videos WHERE id = {$id} AND user = {$user}");
$qq = mysqli_query($conc, "DELETE FROM comment WHERE cid = {$id} AND type = 3");
if ($q) {
@unlink("../video/" . $vid);
if (!strstr($img, DEF_VID_IMG)) {
@unlink("../prev/" . $img);
}
$con->close_db_con($conc);
exit("<div {$style}>Successfully Deleted.</div>");
} else {
$con->close_db_con($conc);
exit("<div {$style}>Error deleting video.</div>");
}
}
if (isset($_POST["upd"])) {
$id = intval($_POST["id"]);
$name = strclean($_POST["name"]);
$info = strclean($_POST["info"]);
示例9: unlink
}
if (file_exists($temp_file)) {
unlink($temp_file);
}
// -------------- End Resizing i Croping funkcije za sliku -----------------
// Prikazujemo rezultate da bi smo mogli videti i testirati sta se desilo
//echo "The file named <strong>$fileName</strong> uploaded successfuly.<br /><br />";
//echo "It is <strong>$fileSize</strong> bytes in size.<br /><br />";
//echo "It is an <strong>$fileType</strong> type of file.<br /><br />";
//echo "The file extension is <strong>$fileExt</strong><br /><br />";
//echo "The Error Message output for this upload is: $fileErrorMsg";
} else {
$photo = 'none';
}
// Kraj obrade u uploada slike
// Unosimo novu kategoriju u bazu
$DB = new db();
$SQL = "INSERT INTO gallery (\n\t\t\t\t ph_name,\n\t\t\t\t ph_info,\n\t\t\t\t\tphoto,\n\t\t\t\t\tph_show,\n\t\t\t\t\tph_datum,\n\t\t\t\t\tph_type\n\t\t\t\t) VALUES( \n\t\t\t\t '" . $DB->c($ph_name) . "', \n\t\t\t\t '" . $DB->c($ph_info) . "', \n\t\t\t\t '" . $DB->c($photo) . "', \n\t\t\t\t '" . $DB->c($ph_show) . "', \n\t\t\t\t '" . $DB->c($ph_date) . "', \n\t\t\t\t '" . $DB->c($ph_type) . "'\n\t\t\t\t)";
$result = $DB->query($SQL);
$DB->close();
$result = true;
if ($result) {
$poruka = "image uploaded successfully!";
} else {
$poruka = "Error, Image is not uploaded, please try again";
}
} else {
$poruka = "Unauthorized direct access to the page!";
}
header("Location: gallery2.php?message={$poruka}");
}
示例10: exit
<?php
session_start();
include "../scripts/db.php";
if (!isset($_SESSION["uid"], $_SESSION["user"])) {
exit("<div class='m_s_g'>Invalid Authentication<div>");
}
$uid = intval($_SESSION["uid"]);
if ($uid != 0 && isset($uid)) {
$con = new db();
$conc = $con->c();
$num = 0;
$subjres = mysqli_query($conc, "SELECT `id` FROM `msg_subj` WHERE `u1` = {$uid} OR `u2` = {$uid}");
if ($subjres) {
while ($sb = mysqli_fetch_array($subjres)) {
$msg = mysqli_query($conc, "SELECT `new`,`uid` FROM `msg` WHERE `new` = 1 AND `cid` = " . $sb[0] . " ORDER BY `id` DESC");
if ($msg) {
$ltv = mysqli_fetch_array($msg);
$numr = mysqli_num_rows($msg);
if ($numr > 0 && $ltv[1] != $uid) {
$num = $num + $numr;
}
}
}
}
$num = $num > 0 ? $num : "";
$subjres = NULL;
$sb = NULL;
echo $num;
$_SESSION["msg_num"] = $num;
}
示例11: db
<?php
include "../scripts/db.php";
$con = new db();
$conc = $con->c();
header("Content-Type: text/xml");
$user = md5($_POST["user"]);
echo "<?xml version='1.0' encoding='utf-8' ?><bubble uid='{$user}'>";
$action = $_POST["action"];
$p = sha1($_POST["p"]);
$id = $_POST["id"];
$time = $_POST["time"];
$msg = _hstr_(strclean($_POST["msg"]), false);
switch ($action) {
case 1:
$q = mysqli_query($conc, "SELECT * FROM `users` WHERE `em` = '{$user}' AND `pass` = '{$p}' ");
$r = mysqli_fetch_assoc($q);
if (mysqli_num_rows($q) == 1) {
echo "<name>" . $r["fname"] . " " . $r["lname"] . "</name>";
echo "<img>" . str_replace("../", "http://localhost/bubble/", $r["img_m"]) . "</img>";
} else {
echo "<error>Invalid Credentials</error>";
}
break;
case 2:
$q = mysqli_query($conc, "SELECT `email`,`femail`,`id` FROM `pals` WHERE `email` = '{$user}' OR `femail` = '{$user}' ");
$q2 = mysqli_query($conc, "UPDATE `chat_online` SET `time` = " . date("U") . " WHERE `email` = '{$user}'");
while ($r = mysqli_fetch_array($q)) {
$em = $r[0] == $user ? $r[1] : $r[0];
$tm = date("U") - 60 * 10;
$q2 = mysqli_query($conc, "SELECT `email` FROM `chat_online` WHERE `email` = '{$em}' AND `time` > {$tm}");
示例12: intval
<table cellpadding="5"><tr>
<?php
include "../scripts/db.php";
$limit = intval($_POST["limit"]);
if (isset($limit)) {
$con = new db();
$conc = $con->c();
$i = 0;
$q = mysqli_query($conc, "SELECT * FROM users ORDER BY id DESC");
while ($r = mysqli_fetch_array($q)) {
$i++;
$img = substr($r[7], 1, strlen($r[7]));
echo "<td><a target='_blank' href='" . PTH . "/{$r['0']}' title='{$r['3']}' style='color:#fff;text-shadow:2px #444;'><div style='background:#000 url(" . PTH . "{$img}) no-repeat center;' class='smpdiv' ></div></a></td>";
if ($i % 15 == 0) {
//echo "<tr></tr>";
}
if ($i == 30) {
break;
}
}
mysqli_close($con->c());
}
?>
</tr></table>
示例13: work_list
function work_list($folder)
{
?>
<!-- Page Header -->
<div class="content bg-gray-lighter">
<div class="row items-push">
<div class="col-sm-7">
<h1 class="page-heading">
Radovi <small>Spisak ilustracija, dizajna, fotografija.</small>
</h1>
</div>
<div class="col-sm-5 text-right hidden-xs">
<ol class="breadcrumb push-10-t">
<li>Radovi</li>
<li><a class="link-effect" href="works.php">Lista</a></li>
</ol>
</div>
</div>
</div>
<!-- END Page Header -->
<!-- Page Content -->
<div class="content content-boxed">
<!-- <h2 class="content-heading">Your content</h2> -->
<!-- Table Sections (.js-table-sections class is initialized in App() -> uiHelperTableToolsSections()) -->
<div class="block">
<div class="block-header">
<div class="block-content">
<!--
Separate your table content with multiple tbody sections. Add one row and add the class .js-table-sections-header to a
tbody section to make it clickable. It will then toggle the next tbody section which can have multiple rows. Eg:
<tbody class="js-table-sections-header">One row</tbody>
<tbody>Multiple rows</tbody>
<tbody class="js-table-sections-header">One row</tbody>
<tbody>Multiple rows</tbody>
<tbody class="js-table-sections-header">One row</tbody>
<tbody>Multiple rows</tbody>
You can also add the class .open in your tbody.js-table-sections-header to make the next tbody section visible by default
-->
<table class="js-table-sections table table-hover table-vcenter">
<thead>
<tr>
<th style="width: 30px;"></th>
<th class="text-center" style="width: 100px;"><i class="si si-grid"></i></th>
<th>Naslov</th>
<th style="width: 15%;" class="hidden-xs text-center">Kategorija/boja</th>
<th class="hidden-xs" style="width: 15%;">Datum</th>
<th class="text-center" style="width: 100px;">Akcija</th>
</tr>
</thead>
<?php
$DB = new db();
$SQL = "SELECT \n\t\t\t\tworks.id_work AS id_work,\n\t\t\t\tworks.id_cat AS id_cat,\n\t\t\t\tworks.work_name AS work_name,\n\t\t\t\tworks.work_desc AS work_desc,\n\t\t\t\tworks.work_color AS work_color,\n\t\t\t\tworks.work_date AS work_date,\n\t\t\t\tworks.work_mpic AS work_mpic,\n\t\t\t\tworks.work_show AS work_show,\n\t\t\t\tcategories.cat_name AS cat_name\n\t\t\tFROM works\n\t\t\tLEFT JOIN categories ON(works.id_cat=categories.id_cat)\n\t\t\tORDER BY works.id_work DESC";
$DB->query($SQL);
while ($row = $DB->fetch_assoc()) {
$id_work = $row['id_work'];
$id_cat = $row['id_cat'];
$work_name = $row['work_name'];
$work_desc = $row['work_desc'];
if ($work_desc != "") {
$work_desc = '<span class="label label-success">Da</span>';
} else {
$work_desc = '<span class="label label-danger">Ne</span>';
}
$work_color = $row['work_color'];
$work_date = $row['work_date'];
$work_mpic = '../images/work/thumb_' . $row['work_mpic'];
// Proveravam dal slika postoji ili ne , ako nepostoji ucitavamo onu noimage i menjamo boju reda.
if (file_exists($work_mpic)) {
$work_mpic = $work_mpic;
} else {
$work_mpic = $folder . '/img/avatars/avatar3.jpg';
}
$work_ipic = $row['work_ipic'];
$work_show = $row['work_show'];
$cat_name = $row['cat_name'];
$DB2 = new db();
$SQL = "SELECT count(*) AS koliko FROM segments WHERE id_work ='" . $DB2->c($id_work) . "' GROUP BY id_work";
$DB2->query($SQL);
$koliko = 0;
while ($row2 = $DB2->fetch_assoc()) {
$koliko = $row2['koliko'];
}
$DB2->close();
?>
<tbody class="js-table-sections-header">
<tr>
<td class="text-center">
<i class="fa fa-angle-right"></i>
</td>
<td class="text-center"><img class="img-avatar img-avatar48" src="<?php
echo $work_mpic;
?>
" alt=""></td>
<td class="font-w600"><?php
echo $work_name;
//.........这里部分代码省略.........
示例14: post
function post($id, $uid, $userid, $user, $name, $img, $date, $post, $var, $rid, $type, $client)
{
$client_apps_array = array("", "web", "mobile", "");
$client_apps_url = array("", "./?force_web=2", "./?force_mobile=2", "");
$rp = "";
$client1 = $client_apps_array[$client];
$clienturl = $client_apps_url[$client];
$client = "<a href='{$clienturl}' class='small' target='_blank'>via {$client1}</a>";
if ($type == 1) {
$con = new db();
$conc = $con->c();
$q = mysqli_query($conc, "SELECT `post`.`id`,`users`.`user` FROM `post` INNER JOIN `users` ON (`users`.`id` = `post`.`user`) WHERE `post`.`id` = {$rid} ");
$r = mysqli_fetch_array($q);
$pid = $r[1];
$rp = "<a href='" . PTH . "/?view={$rid}&t={$type}' class='del' onclick='return _op({$rid},{$type})' title='in reply to {$pid}'><table><tr><td><div class='preply'></div></td><td>to {$pid}</td></tr></table></a>";
$con->close_db_con($conc);
} else {
if ($type == 2) {
$con = new db();
$conc = $con->c();
$q = mysqli_query($conc, "SELECT `post`.`id`,`users`.`user` FROM `post` INNER JOIN `users` ON (`users`.`id` = `post`.`user`) WHERE `post`.`id` = {$rid} ");
$r = mysqli_fetch_array($q);
$pid = $r[1];
$con->close_db_con($conc);
$rp = "<a href='" . PTH . "/?view={$rid}&t={$type}' class='del' onclick='return _op({$rid},{$type})' title='refed from {$pid}'><table><tr><td><div class='prefeed'></div></td><td>from {$pid}</td></tr></table></a>";
}
}
$bb = ".";
$imgclass = "smpdiv";
$post_style = "";
$url = "./{$user}";
if ($_SESSION["mobile"] == 2) {
// $bb = "..";
// $url = "./?i=$user";
$imgclass = "ssmpdiv";
}
if ($var == "pop") {
$style = "style='width:400px;'";
$var = "";
$imgclass = "ssmpdiv";
$post_style = "style='font-size:10px;'";
}
if ($_SESSION["uid"] != 0) {
$con = new db();
$conc = $con->c();
$del = $uid == $userid ? "<a onclick='return _del(event,\"{$id}\")'><div title='delete' class='delete'></div></a>" : "";
$nl = numlikes($conc, $id);
$like = _like($conc, $id, $uid) ? " style='background-image:url(" . PTH . "/img/like.png);' class='like' title='unlike {$nl}'" : " title='like {$nl}' style='background:url(" . PTH . "/img/like_2.png) center no-repeat;' class='like'";
$con->close_db_con($conc);
$llike = " <div {$like} onclick='_like(event,{$id},{$userid})' class='like' onmouseover='_textgrow(event)' align='center'>" . $nl . "</div>";
$reply = "<a href='" . PTH . "/?rep={$id}&u={$user}&t=1' class='del' onclick='return _reply(event)' rid='{$id}' u='{$user}'><div class='preply' title='reply {$name}'></div></a>";
$repost = "<a href='" . PTH . "/?rep={$id}&u={$user}&t=2' class='del' onclick='return _repost(event)' rid='{$id}' u='{$user}'><div title='refeed' class='prefeed' ></div></a>";
}
$style = stripos($post, "@" . $_SESSION["user"]) !== false ? "style='border-left:2px solid #444;'" : "";
// $style = $userid == $uid?"style='border-right:1px solid #444;'":$style;
// $style = "";
//_pop(event,$userid)
return "<div class='post' id='post{$id}' {$style} onmouseover='_postOver(event)' >\n\t\t\t\t<table width='100%'><tr><td width='10%'><a href='{$url}' onclick='return _pop(event,\"{$user}\")' ><div class='{$imgclass}' style='background-image:url(" . PTH . "{$img});'></div></a></td>\n\t\t\t\t<td width='90%'>\n\t\t\t\t<table width='100%'><tr><td width='100%'><a href='{$url}' onclick='return _pop(event,\"{$userid}\")' onmouseover='' >{$user}</a> <i style='_pn'>{$name}</i><br/><span class='_post' id='post_span_" . $id . "' {$post_style}>{$post}</span><br/></td></tr></table>\n\t\t\t\t<table style='float:right;'><tr><td valign='middle'><a class='del' style='display:none;' udate='" . date("U", $date) . "' title='" . date("r", $date) . "' href='" . PTH . "/?view={$id}&t=0' onclick='return _op({$id},0);'>" . gtime($date) . "</a></td><td valign='middle'>{$rp}</td><td valign='middle'>{$client}</td><td>{$llike}</td><td>{$reply}</td><td>{$repost}</td><td>{$del}</td><td valign='middle'>{$var}</td></tr></table></td></tr></table>\n\t\t\t\t</div> ";
}
示例15: db
</ol>
</div>
</div>
</div>
<!-- END Page Header -->
<!-- Page Content -->
<div class="content">
<!-- <h2 class="content-heading">Your content</h2> -->
<div class="col-sm-6 col-sm-offset-3">
<div class="block block-themed">
<?php
$workdata = $request->post;
$DB = new db();
foreach ($workdata as $name => $value) {
$workdata[$name] = $DB->c($value);
}
$old_pass = md5($workdata['old_pass']);
$new_pass = md5($workdata['new_pass']);
$cnew_pass = md5($workdata['cnew_pass']);
if ($new_pass == $cnew_pass) {
// Upisujemo novu sifru na mesto gde je bila stara ako je dobro uneta stara sifra
$SQL = "UPDATE korisnik SET pass='" . $new_pass . "' WHERE (idko='" . $_SESSION['sidko'] . "' AND pass='" . $old_pass . "')";
$DB = new db();
$DB->query($SQL);
// Proveravamo dal je nova sifra upisana , ako jeste onda je stara bila ok.
$SQL = "SELECT * FROM korisnik WHERE (idko='" . $_SESSION['sidko'] . "' AND pass='" . $new_pass . "')";
$DB->query($SQL);
$num = $DB->num_rows();
$DB->close();
if ($num != 1) {