예제 #1
0
파일: find.php 프로젝트: nefayran/FYF
echo "<meta charset='utf-8'>";
//Пока работаем с 1 файлом
//$code = getcode('index.html');
//Ищем файлы (Необходимо указать проверяемую директорию)
?>

<h2>Что проверить?</h2>
<form action="find.php" method="post">
 <p>Директория: <input type="text" name="directory" value="/home/nefayran/Web/site/img" /></p>
 <p>Файл: <input type="text" name="file" value="index.html" /></p>
 <p><input type="submit" value = "Искать"/></p>
</form>

<?php 
$files = getdirs($_POST['directory']);
$code = getcode($_POST['file']);
//Код есть, файл есть, теперь надо сравнить
//Проход по файлам
echo '<h2>Что используется:</h2>';
echo "<ul>";
$good = array();
for ($i = 2; $i < count($files); $i++) {
    //Задаем файл ссылку на который надо найти
    $file = $files[$i];
    //Проход по коду
    for ($j = 0; $j < count($code); $j++) {
        if (stristr($code[$j], $file) == TRUE) {
            echo '<li>' . $file . '</li>';
            //Запомним используемые файлы
            array_push($good, $file);
        }
        del();
        break;
    case "copy":
        copynew();
        break;
    case "delall":
        delall();
        break;
    case "export":
        export();
        break;
    case "upexpsave":
        upexpsave();
        break;
    case "getcode":
        getcode();
        break;
    case "breakpoint":
        breakpoint();
        break;
    default:
        clearSessionart();
        headAdminCollect("文章自定义采集项目编辑");
        main();
        break;
}
function export()
{
    global $db;
    $p_id = be("get", "p_id");
    $fields = $db->getTableFields(app_dbname, "{pre}cj_art_projects");
예제 #3
0
<?php

session_start();
function getcode($cookie)
{
    $url = "http://172.18.0.240/selfsearch/Other/pic.aspx";
    $filename = "../code/" . session_id() . ".jpeg";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_REFERER, 'http://172.18.0.240/selfsearch/UserInfo/UserLogin.aspx');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie);
    $imageData = curl_exec($curl);
    curl_close($curl);
    $tp = @fopen($filename, 'w');
    fwrite($tp, $imageData);
    fclose($tp);
    return $filename;
}
ob_start();
$pic = getcode($_SESSION['cookieurl']);
$img = imagecreatefromjpeg($pic);
header("Content-Type:image/jpeg");
imagejpeg($img);
imagedestroy($img);
session_destroy();
@unlink($pic);
ob_flush();
예제 #4
0
파일: code.php 프로젝트: 52fhy/fhyBlog
        }
        //添加干扰线
        for ($i = 0; $i < 2; $i++) {
            $color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255));
            imageline($im, rand(0, $width), rand(0, $height), rand(0, $width), rand(0, $height), $color);
        }
        //添加一个矩形框
        $color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255));
        imagerectangle($im, 0, 0, $width - 1, $height - 1, $color);
    }
    //生成图片
    header("content-type:image/jpeg");
    imagejpeg($im);
    //释放图片
    imagedestroy($im);
}
/*
*  获取随机字符串函数
*/
function getchar($len = 4, $type = 0)
{
    $str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    $c = '';
    $arr = array(9, 35, 61);
    for ($i = 0; $i < $len; $i++) {
        $c .= $str[rand(0, $arr[$type])];
    }
    return $c;
}
getcode(4, 2, 1);