本文整理汇总了PHP中obj::singleData方法的典型用法代码示例。如果您正苦于以下问题:PHP obj::singleData方法的具体用法?PHP obj::singleData怎么用?PHP obj::singleData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obj
的用法示例。
在下文中一共展示了obj::singleData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __autoload
<?php
function __autoload($class)
{
include 'lib/' . $class . '.php';
}
$obj = new obj();
if (isset($_POST["username"])) {
$username = trim($_POST["username"]);
$user = $obj->singleData($username, "email", "tbl_ut_pass");
if ($user) {
echo '<img src="img/not-available.png" />';
echo '<script>document.getElementById("user-reg").disabled = true;</script>';
} else {
echo '<img src="img/available.png" />';
echo '<script>document.getElementById("user-reg").disabled = false;</script>';
}
}
if (isset($_POST["CourseName"])) {
$CourseName = trim($_POST["CourseName"]);
$CourseName_valid = $obj->singleData($CourseName, "title", "tbl_lc_course");
if ($CourseName_valid) {
echo '<img src="img/not-available.png" />';
echo '<script>document.getElementById("myBtn").disabled = true;</script>';
} else {
echo '<img src="img/available.png" />';
echo '<script>document.getElementById("myBtn").disabled = false;</script>';
}
}
示例2: extract
// echo $_SESSION['login'];
?>
</a></li>
<li><a href="#">ご利用方法</a></li>
<li><a rel="leanModal" href="#m_createCourse">コース作成</a></li>
<li><a href="#">ヘルプ</a></li>
<li><a href="?q=logout">Logout</a></li>
</ul>
</nav>
<ul id="hbtns" class="clearfix">
<li class="cart"><a href="cart.php"><span class="icon-shopping2"></span>カートを見る</a></li>
<?php
if (!isset($_SESSION['fb_login'])) {
$img_email = $obj->singleData($_COOKIE['lc_login_id'], 'email', 'tbl_ut_pass');
extract($img_email);
$img_user = $obj->singleData($img_email['uid'], 'uid', 'tbl_ut_user');
extract($img_user);
?>
<li class="loginInfo"><a href="profile_edit.php"><span><img class="user-image" src="img/user/<?php
echo $profile_img;
?>
" alt="栗富 太郎太郎"></span><?php
echo ucfirst($img_user['name2']) . " " . ucfirst($img_user['name1']);
?>
</a></li>
<?php
} else {
?>
<li class="loginInfo"><a href="profile_edit.php"><span><img class="user-image" src="<?php
示例3: saveFBdetails
function saveFBdetails()
{
$obj = new obj();
$data = false;
$_SESSION['fb_login'] = true;
$_SESSION['fb_lastname'] = $_POST['fb_lastname'];
$_SESSION['fb_firstname'] = $_POST['fb_firstname'];
$_SESSION['fb_email'] = $_POST['fb_email'];
$_SESSION['fb_pic'] = $_POST['fb_pic'];
//CHECK IF EMAIL EXISTS
$checkUser = $obj->singleData($_SESSION['fb_email'], "email", "tbl_ut_pass");
if ($checkUser != NULL) {
extract($checkUser);
//IF ALREADY HAVE LC ACCOUNT
if ($usertype == 1) {
$usertype = 3;
$fb_update = array('usertype' => $usertype);
$obj->update('tbl_ut_pass', $fb_update, "WHERE uid = " . $uid);
$_SESSION['uid'] = $uid;
} else {
$_SESSION['uid'] = $uid;
}
} else {
$usertype = 2;
$obj->newReg($_SESSION['fb_firstname'], $_SESSION['fb_lastname'], "tbl_ut_user");
foreach ($obj->showLastId("tbl_ut_user", "uid") as $value) {
extract($value);
$_SESSION['uid'] = $value['uid'];
}
$fb_data = array('uid' => $uid, 'email' => $_SESSION['fb_email'], 'usertype' => $usertype);
$obj->insert('tbl_ut_pass', $fb_data);
}
$_SESSION['user_lastname'] = $_POST['fb_lastname'];
$_SESSION['user_firstname'] = $_POST['fb_firstname'];
$_SESSION['user_pic'] = $_POST['fb_pic'];
$data = $_SESSION['uid'];
echo json_encode($data);
}
示例4: extract
</p>
<p>Gender:
<input type="radio" name="gen" value="male" /> Male
<input type="radio" name="gen" value="female" /> Female
</p>
<p>Occupation: <input type="text" name="oct" /></p>
<p>Zip code: <input type="text" name="zipcd" /></p>
<p>State: <input type="text" name="state" /></p>
<p>city: <input type="text" name="city" /></p>
<p>Address 1: <input type="text" name="addr1" /></p>
<p>Address 2: <input type="text" name="addr2" /></p>
<p>tel: <input type="text" name="tel" /></p>
<p>tel 2: <input type="text" name="tel2" /></p><p>Address 1: <input type="text" name="dmail_flg" /></p>
<input type="submit" name="submit" value="update" />
</form>
<?php
if (isset($_POST['submit'])) {
$accountName = $_POST['accountName'];
$password = $_POST['password'];
$user = $obj->singleData($accountName, 'email', 'tbl_ut_pass');
extract($user);
if (!empty($user)) {
if (password_verify($password, $pwd)) {
echo 'Password is valid!';
} else {
echo 'Invalid password.';
}
} else {
echo "username does not exist";
}
}