Example #1
0
function getImgLinks($dir)
{
    $imgArray = array();
    $dir = new DirectoryIterator($dir);
    foreach ($dir as $fileinfo) {
        if (!$fileinfo->isDot() && !$fileinfo->isFile()) {
            getImgLinks($fileinfo->getPathname());
        }
        if (!$fileinfo->isDot() && $fileinfo->isFile()) {
            array_unshift($imgArray, $fileinfo->getPathname());
        }
    }
    return $imgArray;
}
function finaliseLinks($url, &$resizedImgLinks)
{
    $targets = array('realestate.com.au', 'milesre.com.au', 'portplus.com');
    foreach ($targets as $t) {
        if (strpos($url, $t) !== false) {
            $site = $t;
            break;
        }
    }
    //figureout which site we're searching
    switch ($site) {
        case "realestate.com.au":
            $pageLinks = resolvePageLinks($url);
            $carouselLink = cleanLinks('~(photogal)~i', $pageLinks);
            $imgLinks = getImgLinks($carouselLink[0]);
            $cleanedImgLinks = cleanLinks('~(65x48)~i', $imgLinks);
            $resizedImgLinks = resizeLinks($cleanedImgLinks, '65x48', '400x300');
            break;
        case "milesre.com.au":
        case "portplus.com":
            $imgLinks = getImgLinks($url);
            $cleanedImgLinks = cleanLinks('~(width=61)~i', $imgLinks);
            $resizedImgLinks = resizeLinks($cleanedImgLinks, 'width=61', 'width=400');
            break;
    }
}
Example #3
0
<?php

include "randjpg.php";
$imgArray = getImgLinks("img");
include "conn.php";
$path = $imgArray[rand(0, count($imgArray) - 1)];
$query = "SELECT *  FROM user";
$query_results = mysql_query($query);
$flag = 0;
while ($row = mysql_fetch_array($query_results)) {
    if ($row['name'] == @$_COOKIE['name'] && $row['password'] == @$_COOKIE['password']) {
        $flag = 1;
    }
}
if ($flag == 1) {
    ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>笔记</title>	
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet/less" type="text/css" media="screen and (min-device-width: 1024px)" href="less.css">
  <link rel="stylesheet/less" type="text/css" media="screen and (max-device-width: 600px)" href="tinyScreen.css" />
  <script type="text/javascript" src="less-1.3.0.min.js"></script>
    <script type="text/javascript" src="jquery.js"></script>