<?php

session_start();
/* includes PHP functions, activates the myAutoloader*/
include 'functions.php';
spl_autoload_register('my_autoloader');
/*REVISION*/
//Requests the setup table
$db = new CRUD();
//grabs as needed classes
$getCont = new GetContent();
//check for password
if ($_POST['logout'] == true) {
    /*Unsets session variables*/
    $_SESSION = array();
    if (ini_get("session.use_cookies")) {
        $params = session_get_cookie_params();
        setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
    }
    session_destroy();
}
if ($_SESSION['authorized'] == !true) {
    $authorValue = new AuthorizeAdmin();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
Exemple #2
0
<?php

include 'QueryList.class.php';
include 'GetContent.class.php';
include 'Parse.class.php';
include 'GetImg.class.php';
header("Content-type:text/html;charset=utf-8");
$content = new GetContent('http://www.dianping.com/search/category/4/35/g2834');
$data = $content->outPut();
for ($i = 0; $i < count($data); $i++) {
    $img = new GetImg($data[$i]['html_text']);
    $url = $img->prepare();
}
print_r($data);
// $img = new GetImg('/uploads/html/21129429.html');
// $url = $img->prepare();
// print_r($url);
<?php

session_start();
/* includes PHP functions, activates the myAutoloader*/
include 'functions.php';
spl_autoload_register('my_autoloader');
/*REVISION*/
//Requests the setup table
$db = new CRUD();
$setup = $db->dbSelect('setup', 'layout', 'setup');
$setup = $setup['0'];
//grabs as needed classes
$getCont = new GetContent();
//Checks to see if the site is live or if the current user is an admin.
$siteLive = new IsSiteLive();
$siteLive = $siteLive->getIsLive();
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <?php 
enqueue_styles();
?>

    <title><?php 
echo $setup['title'];
?>
Exemple #4
0
 public static function setUserAgent($rand = true)
 {
     if (!$rand) {
         return $_SERVER['HTTP_USER_AGENT'];
     }
     $arrUserAgent = self::$arrAgent;
     if (empty($arrUserAgent)) {
         include __ROOT_PATH . 'etc/crawlConfig.php';
         self::$arrAgent = $arrUserAgent;
     }
     $num = count($arrUserAgent) - 1;
     if (self::$userAgent == '') {
         self::$userAgent = $arrUserAgent[$num];
         return self::$userAgent;
     }
     $num = rand(0, $num);
     $userAgent = $arrUserAgent[$num];
     self::$userAgent = $userAgent;
     return $userAgent;
 }