|
|
|
สอบถามปัญหา Deprecated: Function eregi() is deprecated ช่วยชี้แนะที่ครับ |
|
|
|
|
|
|
|
Code (PHP)
<?
include "sessionuser.php";
include "functionavp32.php";
if($f!=""){
header("location:../pdf/$u/$y/$m/$f");
}
?>
<HTML>
<HEAD>
<TITLE> ถอดรหัส</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<?
include "../include/connect.php";
$a = $_SESSION["sess_id"];
$sql2 = "select * from user where user_id = $a ";
mysqli_query($conn,"set names tis620");
$result2 = mysqli_query($conn,$sql2);
$data2 = mysqli_fetch_array($result2);
$key = $data2[user_key];
if ($_POST[key] != $key ){
//echo "<center>คุณกรอกรหัสเปิดไฟล์ลับไม่ถูกต้อง <br> กรุณากรอกรหัสผ่านใหม่ครับ<br><br> ";
//echo "<input type='button' value=' ปิด ' onClick='window.close()'> </center>";
exit;
}
?>
</BODY>
</HTML>
<?
//if($_FILES[file][name]!=""){
// copy($_FILES[file][tmp_name],"file/".$_FILES[file][name]);
$sql3 = "select * from send where send_id = '$_GET[user_send_id]'";
$result3 = mysqli_query($conn,$sql3);
$data3 = mysqli_fetch_array($result3);
$user_s = $data3[user_id];
$date_f = $data3[send_date];
$user_key = $data3[send_key];
$key = AVP32($user_key);
$aa=$_GET[name_book];
$year = substr( $date_f , -5,-1);
$month = substr( $date_f , 4,-6);
//$fd = substr($date_f , 4);
$fp=fopen("../pdf/$user_s/$year/$month/$aa","r+");
$i=1;
while($ln=fgets($fp)){
if(eregi("filename=",$ln)){
list($a,$filename)=explode("=",$ln);
$line=$i;
break;
}
$i++;
}
$fp=fopen("../pdf/$user_s/$year/$month/$aa","r+");
$i=1;
while($ln=fgets($fp)){
if($i>$line){
$x=explode(" ",$ln);
for($j=0;$j<count($x)-1;$j++){
$num = $x[$j]/$key;
$num = $num ^ 100;
$num = chr($num);
$str .= $num;
}
}
//echo "$str<br>";
$i++;
}
//fclose($fp);
// begin set extent file
if(eregi(".png",$filename))
$filename="ex.png";
if(eregi(".doc",$filename))
$filename="ex.doc";
if(eregi(".jpg",$filename))
$filename="ex.jpg";
if(eregi(".avi",$filename))
$filename="ex.avi";
if(eregi(".ppt",$filename))
$filename="ex.ppt";
if(eregi(".xls",$filename))
$filename="ex.xls";
if(eregi(".mp3",$filename))
$filename="ex.mp3";
if(eregi(".bmp",$filename))
$filename="ex.bmp";
if(eregi(".php",$filename))
$filename="ex.php";
if(eregi(".html",$filename))
$filename="ex.html";
if(eregi(".pdf",$filename))
$filename="ex.pdf";
if(eregi(".gif",$filename))
$filename="ex.gif";
// end set exten file
$fp2=fopen("../pdf/$user_s/$year/$month/".$filename,"w+");
fwrite($fp2,$str);
//echo "filename=$filename";
//echo "<script>location='decode.php?f=$filename&u=$user_s&y=$year&m=$month';</script>";
fclose($fp2);
//unlink($filename);
//}
?>
Tag : PHP, MySQL, HTML/CSS, JavaScript, Ajax, jQuery
|
|
|
|
|
|
Date :
2016-05-17 08:22:54 |
By :
settachai |
View :
985 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไปอ่านมาเหมือนกับว่า ปกติจะเป็นงี้
Code (PHP)
if(eregi(".png",$filename))
ต้องใส่คั้นแบบนี้มั้งนะ
Code (PHP)
if(preg_match("/.png/",$filename))
ผมไม่ได้เก่งนะ 55555
|
ประวัติการแก้ไข 2016-05-17 10:23:51
|
|
|
|
Date :
2016-05-17 10:23:21 |
By :
nook00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|