PHPÊý×Ö¼ÓÃܽâÃÜÀà
<?php
/* ----------------------------------------------------------------------------
* Script Name: encrypt.php
* Creation Date: 2008-4-7 10:36
* Last Modified: 2008-4-12 16:00
* Author: meyu
* Copyright (c) 2007
* Purpose: Êý×Ö×Ö·û´®¼òÒ×¼Ó½âÃÜ
* ----------------------------------------------------------------------------*/
class Encryption {
/**
* ×îÖÕµÄÃÜÎÄ´úÂ룬¿ÉÉèΪÈÎÒâ²»ÖØ¸´µÄ10λӢÎÄ×Ö·ûa-zA-Z
*/
private $replacement = 'urskydMeIV';
/**
* Ôö¼ÓµÄÃÜÎĵÚһ룬¿ÉÉèΪ1λ³ý0ÒÔÍâµÄÕûÊý£¬¼´ 1-9
*/
private $prefix = "8";
/**
* ¹«Ô¿,³¤¶ÈСÓÚ8λµÄÕýÕûÊý
*/
private $match = "111111";
/**
* ת»»ºó¶ÔÕÕÊý×é
*/
private $replaceenc;
private $replacedec;
function __construct() {
for($i =0; $i < 10; $i++) {
$this->replaceenc['/'.$i.'/'] = $this->replacement{$i};
$this->replacedec['/'.$this->replacement{$i}.'/'] = $i;
}
}
public function encrypt($str) {
return preg_replace(
array_keys($this->replaceenc),
$this->replaceenc,
$this->mynotin(preg_replace("/(.)(.)/", "${2}${1}", $str))
);
}
public function decrypt($str) {
return preg_replace("/(.)(.)/", "${2}${1}",
$this->mynotout(preg_replace(array_keys($this->replacedec),$this->replacedec,$str))
);
}
private function mynotin($str) {
$str_out = "";
$i = 0;
while(isset($str{7*$i})) {
$str_out .= (($this->prefix.substr($str, $i*7, 7))+0)^$this->match;
$i++;
}
return $str_out;
}
private function mynotout($str) {
$str_out = "";
$i = 0;
while(isset($str{8*$i})) {
$str_out .= substr((substr($str, $i*8, 8)+0)^$this->match, 1);
$i++;
}
return $str_out;
}
}
?>
Ïà¹ØÎĵµ£º
PHP µÄ´íÎ󱨸æ
display_errors = Off
error_reporting = E_ALL
display_errors ÊÇ·ñÏÔʾ´íÎó¡£Ä¬ÈÏÖµÊÇ Off¡£ÒªÈÿª·¢¹ý³Ì¸ü¼ÓÇáËÉ£¬Çë°ÑÕâ¸öÖµÉèΪ On£º
display_errors = On
error_reporting ±äÁ¿µÄĬÈÏÖµÊÇ E_ALL¡£Õâ¸öÉèÖûáÏÔʾ´Ó²»Á¼±àÂëʵ¼ùµ½ÎÞº¦Ìáʾµ½³ö´íµÄËùÓÐÐÅÏ¢¡£E_ALL ¶ÔÓÚ¿ª·¢¹ý³ÌÀ´ËµÓеã̫ϸ ......
ÔÚPHPÖУ¬ÎļþÉÏ´«Ò»°ãÊÇͨ¹ýmove_uploaded_file£¨£©À´ÊµÏֵġ£
bool move_uploaded_file ( string filename, string destination )±¾º¯Êý¼ì²é²¢È·±£ÓÉ filename Ö¸¶¨µÄÎļþÊǺϷ¨µÄÉÏ´«Îļþ£¨¼´Í¨¹ý PHP µÄ HTTP POST ÉÏ´«»úÖÆËùÉÏ´«µÄ£©¡£Èç¹ûÎļþºÏ·¨£¬Ôò½«ÆäÒÆ¶¯ÎªÓÉ destination Ö¸¶¨µÄÎļþ¡£
Èç¹û filename ²»ÊǺϷ ......
¡¡¡¡“¼¼ÊõÎÊÌâ¶¼ÊÇ¿ÉÒÔ½â¾öµÄ£¬¼¼ÊõÎÊÌâ²»ÊÇ×î×îÖØÒªµÄ”
¡¡¡¡ ×î½ü°ï¹ýһЩÈ˽â¾ö¼¼ÊõÎÊÌ⣬·¢ÏÖÒ»¸öºÜÑÏÖØµÄÎÊÌ⣬ËûÃǵÄ×ö·¨ºÍÎÒ×ʼд³ÌÐòµÄʱºòÊÇÒ»ÑùµÄ£¬ÕâÑùÏÂÈ¥»á×ߺöàµÄÍä·¡£ÏÖÔÚÓÐÒ»Àà³ÌÐòԱ̫¶à£¬ËûÃÇ×ÜÊÇһζµÄ×·Çó“ËùνµÄ¼¼ÊõÄѵ㔣¬×ÜÊǰÑÐÄÊ·ÅÔÚһЩ±ß±ß½Ç½ÇµÄ“³ÌÐò´úÂë ......
//ÉÏ´«Îļþ
$dir="../upfile/jianli";
set_time_limit(0);
extract($_FILES);
if(!empty($res_clett["name"])){
$upfile=&$HTTP_POST_FILES['con_pdf'];
$upfileEx=substr($upfile['name'],-3);
$tmp_name=date("YmdGhis").'.'.$upfileEx;
&nb ......