当前位置: 首页>>代码示例>>PHP>>正文


PHP isConnected函数代码示例

本文整理汇总了PHP中isConnected函数的典型用法代码示例。如果您正苦于以下问题:PHP isConnected函数的具体用法?PHP isConnected怎么用?PHP isConnected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了isConnected函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dbQuery

function dbQuery($queryStr)
{
    if (!isConnected()) {
        connect();
    }
    $result = mysql_query($queryStr) or die("Error: " . mysql_error() . "<br/>Query: " . $queryStr);
    return $result;
}
开发者ID:ChinChuanKuo,项目名称:lottery,代码行数:8,代码来源:db_functions.php

示例2: testIsConnected

 public function testIsConnected()
 {
     $this->assertFalse($_SESSION['auth']);
     $this->assertFalse(isConnected());
     $_SESSION['auth'] = true;
     $this->assertTrue($_SESSION['auth']);
     $this->assertTrue(isConnected());
 }
开发者ID:vmizoules,项目名称:ZZTasksPHP,代码行数:8,代码来源:authenticationTest.php

示例3: getUserEditorBar

 function getUserEditorBar()
 {
     if (!isConnected()) {
         return false;
     }
     $strBar = isset($_SESSION['ACCOUNT_INFO']) && isset($_SESSION['ACCOUNT_INFO']['FCK_BAR']) ? $_SESSION['ACCOUNT_INFO']['FCK_BAR'] : false;
     if (!$strBar) {
         global $configFile;
     }
     if (!$strBar && !$configFile->getParam('FCK_BAR', $strBar)) {
         $strBar = false;
     }
     return $strBar;
 }
开发者ID:ecomotion,项目名称:pollencms,代码行数:14,代码来源:lib_functions.php

示例4: open

 public function open()
 {
     if (!$this - isConnected()) {
         try {
             $this->handle = mysql_connect($this->host, $this->username, $this->password);
             mysql_select_db($this->database);
             if (!$this->handle) {
                 throw new Exception('MySQL Connection Database error: ' . mysql_error());
             }
             $this->isConnected = true;
         } catch (Exception $e) {
             echo $e->getMessage();
         }
     } else {
         echo 'Error: Connection already opened';
     }
 }
开发者ID:rosko,项目名称:AlmazService,代码行数:17,代码来源:DatabaseConnection.php

示例5: stripslashes

'" onmouseout="buy1.src='<?php 
        echo $_url . "Design/xakar/images/homepage/buy.gif";
        ?>
'" title="buy">
												<?php 
        echo '[' . stripslashes($Account['Level_Number']) . ']' . stripslashes($Account['Account_Experience']) . '/' . stripslashes($Account['Level_Experience_Required']);
        ?>
											</a>
										</td>
										<td colspan="2" class="game_panel" valign="top" align="left">
											<img src="<?php 
        echo get_avatar($Account);
        ?>
" width="110" height="84"/>
											<img class="buy1" alt="<?php 
        echo isConnected($Account) ? 'On' : 'Off';
        ?>
" width="31" border="0" height="14" />
										</td>
									</tr>
										

						<?php 
    }
}
?>
					</tbody>
				</table>
			</td>
			<td class="menu_panel" valign="top" width="30%" align="left">
				<ul class="menu">
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:31,代码来源:homepage.php

示例6: userConnected

function userConnected()
{
    session_start_once();
    if (!isConnected()) {
        return null;
    }
    return $_SESSION["userConnected"];
}
开发者ID:Hometgar,项目名称:ppe2,代码行数:8,代码来源:fonctions.php

示例7: round

 echo '<div id="fraudCounterHolder"></div>';
 /* Fraud triangle counts and score */
 $level = "low";
 if ($score >= 6 && $score <= 15) {
     $level = "medium";
 }
 if ($score >= 15) {
     $level = "high";
 }
 echo '<td class="countptd"><span class="fa fa-bookmark-o font-icon-color">&nbsp;&nbsp;</span>' . $countPressure . '</td>';
 echo '<td class="countotd"><span class="fa fa-bookmark-o font-icon-color">&nbsp;&nbsp;</span>' . $countOpportunity . '</td>';
 echo '<td class="countrtd"><span class="fa fa-bookmark-o font-icon-color">&nbsp;&nbsp;</span>' . $countRationalization . '</td>';
 echo '<td class="countctd">' . $level . '</td>';
 echo '<td class="scoretd"><a href=alertData?agent=' . $agent_enc . '>' . round($score, 1) . '</a></td>';
 /* Agent selection for command retrieval */
 if (isConnected($row_a["heartbeat"], $row_a[2]) && $userPermissions != "view") {
     if (isset($_SESSION['agentchecked'])) {
         if ($_SESSION['agentchecked'] == $row_a["agent"]) {
             echo '<td class="specialtd"><a href="dashBoard?agent=' . $agent_enc . '"><img src="images/cmd-ok.svg" onmouseover="this.src=\'images/cmd-mo-ok.svg\'" onmouseout="this.src=\'images/cmd-ok.svg\'" alt="" title="" /></a></td>';
         } else {
             echo '<td class="specialtd"><a href="dashBoard?agent=' . $agent_enc . '"><img src="images/cmd.svg" onmouseover="this.src=\'images/cmd-mo.svg\'" onmouseout="this.src=\'images/cmd.svg\'" alt="" title="" /></a></td>';
         }
     } else {
         echo '<td class="specialtd"><a href="dashBoard?agent=' . $agent_enc . '"><img src="images/cmd.svg" onmouseover="this.src=\'images/cmd-mo.svg\'" onmouseout="this.src=\'images/cmd.svg\'" alt="" title="" /></a></td>';
     }
 } else {
     if (isset($_SESSION['agentchecked'])) {
         if ($_SESSION['agentchecked'] == $row_a["agent"]) {
             echo '<td class="specialtd"><img src="images/cmd-ok.svg" onmouseover="this.src=\'images/cmd-mo-ok.svg\'" onmouseout="this.src=\'images/cmd-ok.svg\'" alt="Agent down" title="Agent down" /></td>';
         } else {
             echo '<td class="specialtd"><img src="images/cmd.svg" onmouseover="this.src=\'images/cmd-mo.svg\'" onmouseout="this.src=\'images/cmd.svg\'" alt="Agent down" title="Agent down" /></td>';
开发者ID:nfsecurity,项目名称:the-fraud-explorer,代码行数:31,代码来源:dashHolder.php

示例8: session_start

<?php

//  ***************************************************************************
/*
 * Auteur : Romain Maillard
 * Date   : 25.09.2015
 * Remarque: Basé sur le code d'un de mes laboratoires de BDR
 */
session_start();
//  Inclusion fichier de fonction.
require_once "include/fonction.php";
//  Vérifie si l'utilisateur est déjà connecté sinon le redirige vers signin.php.
if (!isConnected()) {
    header('Location: signout.php');
}
//  ***************************************************************************
?>
<!DOCTYPE html>
<html lang="fr">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="dist/favicon.ico">

  <title>STI Mail - Home</title>

    <!-- Bootstrap core CSS -->
    <link href="dist/css/bootstrap.min.css" rel="stylesheet">
开发者ID:marom17,项目名称:STI-labo02,代码行数:31,代码来源:index.php

示例9: htmlentities

			body{
				background-color:' . htmlentities($_COOKIE['color']) . ';
			}
			#discussionMessage{
			font-family:' . htmlentities($_COOKIE['police']) . ';
		}
		</style>';
}
?>
<div id="myModal" class="modal">

  <!-- Modal content -->
  <div class="modal-content">
    <div class="modal-header">
      <span class="close">×</span>
      <h2></h2>
    </div>
    <div class="modal-body">
    </div>
    <div class="modal-footer"></div>
  </div>

</div>

<?php 
if (isConnected() and !strpos($_SERVER['PHP_SELF'], "discussion")) {
    echo '
	<div>
		<button id="openContactBox">Afficher les contacts</button>
	</div>';
}
开发者ID:Yamihoshi,项目名称:Projet-Web,代码行数:31,代码来源:nav.php

示例10: getJSONFromCodeError

/* If login exist */
if ($row['mail'] == $login && $login != null) {
    $logOk = true;
} else {
    $response = getJSONFromCodeError(300);
}
/* If password is correct with good login */
if ($logOk && $row['password'] == $password) {
    $passOk = true;
} else {
    if ($logOk && $row['password'] != $password) {
        $response = getJSONFromCodeError(301);
    }
}
/* if all is ok */
if ($logOk && $passOk) {
    $id = $row['id'];
    $name = $row['name'];
    $nickname = $row['nickname'];
    $mail = $row['mail'];
    $admin = $row['admin'];
    $profil = $row['profil'];
    $isCo = isConnected();
    if (!$isCo) {
        createSession($id, $nickname, $name, $mail, $admin, $profil);
        $response = getJSONFromCodeError(200);
    } else {
        $response = getJSONFromCodeError(303);
    }
}
echo json_encode($response);
开发者ID:CrepesAuxOeufs,项目名称:ManagementProject,代码行数:31,代码来源:login.php

示例11: disconnect

 /**
  * this function closes the db connection (if any)
  *
  * @version 1.0
  * @author Andreas Morsing
  * @since 22.04.2005, 21:05:25
  **/
 function disconnect()
 {
     if (isConnected()) {
         $this->dbConnection->close();
     }
     $this->Connected = false;
     $this->dbConnection = null;
 }
开发者ID:tamtrong,项目名称:testlink,代码行数:15,代码来源:int_bugtracking.php

示例12: setcookie

<?php

include "Begin.php";
//En cours de connexion
if (isset($_POST['email']) && isset($_POST['pwd'])) {
    setcookie("email", $_POST['email'], time() + 10000);
    setcookie("pwd", $_POST['pwd'], time() + 10000);
    header('Location: connexion.php');
    exit;
} else {
    if (isset($_COOKIE['email']) && isset($_COOKIE['pwd']) && isConnected()) {
        header('Location: profil.php');
        exit;
    } else {
        if (isset($_GET['unreg'])) {
            echo "<p class = \"err\">Vous êtes désincrit du site. Nous espérons vous revoir bientôt !</p>";
        } else {
            if (isset($_COOKIE['email']) && isset($_COOKIE['pwd'])) {
                echo "<p class = \"err\">Vos identifiants de connexion sont erronés, veuillez réessayer.</p>";
            }
        }
        ?>

			<form action ="connexion.php" method="post">
				<p>Adresse mail : <input type="email" name="email"/></p>
				<p>Mot de passe : <input type="password" name="pwd"/></p>
				<button type="submit" value="Connexion">Connexion</button><input type="button" value="Enregistrement" onClick="parent.location='inscription.php'">
			</form>

			<?php 
    }
开发者ID:jambon-beurre,项目名称:phpEvents,代码行数:31,代码来源:connexion.php

示例13: Connect_db

<?php

include "Begin.php";
$bdd = Connect_db();
if (isConnected() && isset($_GET["idEvent"])) {
    $SQL_Query = 'DELETE FROM Membre_Inscrit_Event
					WHERE Membre_email = "' . $_COOKIE['email'] . '" AND Event_Id = ' . intval($_GET["idEvent"]);
    $query = $bdd->prepare($SQL_Query);
    $query->execute();
    header('location:EventDescr.php?idEvent=' . $_GET["idEvent"]);
} else {
    echo '<script>alert(\'Nique ta mère\');</script>';
}
开发者ID:jambon-beurre,项目名称:phpEvents,代码行数:13,代码来源:unSubscribeTo.php

示例14: getUserDetails

function getUserDetails($userID, $myID = 0)
{
    //echo $userID.$myID;
    $query = "SELECT CONCAT(`first_name`,' ',`last_name`) as 'N'\n\t,church_member_id,`church_id`,`userdp` as 'DP',`email` as 'email',\n\t`phone_number` as 'phone',date_joined,about\n\n\n\tfrom\n\tchurch_members where church_member_id='{$userID}'";
    $results = mysql_query($query) or die(mysql_error());
    $mutualFriend = 0;
    if ($results && mysql_num_rows($results) >= 1) {
        $data = array();
        while ($row = mysql_fetch_assoc($results)) {
            $dataItem['id'] = $row['church_member_id'];
            $dataItem['memberID'] = $dataItem['id'];
            $dataItem['cover'] = loadUserCoverPix($dataItem['id']);
            $dataItem['name'] = ucwords(trim($row['N']));
            $dataItem['profilePic'] = $row['DP'];
            $dataItem['email'] = $row['email'];
            $dataItem['phone'] = $row['phone'];
            $dataItem['about-user'] = $row['about'];
            $dataItem['date_joined'] = ago($row['date_joined'], -1);
            $cid = $row['church_id'];
            $dataItem['churchName'] = getchurchName($cid);
            $dataItem['friends'] = loadFriendsCount($userID);
            $dataItem['CID'] = $cid;
            $data['connection'] = loadFriendsCount($userID);
            if ($userID != $myID) {
                $dataItem['isConnected'] = isConnected($dataItem['id'], $myID);
                if ($dataItem['isConnected'] == 1) {
                    $mutualFriend = $mutualFriend + 1;
                }
                $dataItem['mutualFriends'] = countMutualFriends($dataItem['id'], $myID);
            } else {
                $dataItem['isConnected'] = -10;
                // This ID is mine so dont check Connection
                $dataItem['mutualFriends'] = 0;
            }
            $dataItem['churchprofilePic'] = getchurchlogo($cid);
            //$dataItem['Friends']= loadFriendsCount($userID);;
            $data = $dataItem;
        }
        // echo json_encode($data);
        return $data;
    }
}
开发者ID:samterer,项目名称:Nsore,代码行数:42,代码来源:util.php

示例15: isInstalled

function isInstalled()
{
    if (isConnected()) {
        App::uses('ConnectionManager', 'Model');
        $dataSource = ConnectionManager::getDataSource('default');
        $baseTables = ['categories' => $dataSource->config['prefix'] . 'categories', 'categories_posts' => $dataSource->config['prefix'] . 'categories_posts', 'comments' => $dataSource->config['prefix'] . 'comments', 'links' => $dataSource->config['prefix'] . 'links', 'menus' => $dataSource->config['prefix'] . 'menus', 'options' => $dataSource->config['prefix'] . 'options', 'post_meta' => $dataSource->config['prefix'] . 'post_meta', 'posts' => $dataSource->config['prefix'] . 'posts', 'posts_tags' => $dataSource->config['prefix'] . 'posts_tags', 'tags' => $dataSource->config['prefix'] . 'tags', 'user_meta' => $dataSource->config['prefix'] . 'user_meta', 'users' => $dataSource->config['prefix'] . 'users'];
        $installed = [];
        App::uses('ClassRegistry', 'Utility');
        foreach ($baseTables as $table => $tablePrefix) {
            if (in_array($tablePrefix, $dataSource->listSources()) && count($dataSource->describe($table)) > 0 && count(ClassRegistry::init('Option')->getOptions()) > 0) {
                $installed[$table] = true;
            } else {
                $installed[$table] = false;
            }
        }
    } else {
        $installed['database.php'] = false;
    }
    return !in_array(false, $installed);
}
开发者ID:hurad,项目名称:hurad,代码行数:20,代码来源:bootstrap.php


注:本文中的isConnected函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。