Why are there too many attacks in PHP? When g was just getting started then :? Php Cute cute $ picSizearray (100_1001, 200_1001); $ imagePath .. image; functionparseUrl ($ url) {preg_match ((? Pname [
G networksWhen g then when else:
// Just give me a try.
$ PicSize = array (
'1970 _ 100' => 1,
'2017 _ 000000' => 1
);
$ ImagePath = "../image /";
Function parseUrl ($ url ){
Preg_match ("/(? P [\ W \ d] +) _ w (? P \ D +) _ h (? P \ D + )\.(? P \ W +)/", $ url, $ match );
Return $ match;
}
$ UrlArr = explode ("/", $ _ SERVER ['request _ URI ']);
$ ImgName = $ urlArr [count ($ urlArr)-1];
$ PicInfo = parseUrl ($ imgName );
// Please try again
If (empty ($ picInfo ['width']) | empty ($ picInfo ['height']) |
! Array_key_exists ($ picInfo ['width']. '_'. $ picInfo ['height'], $ picSize) die ');
$ OriginalPic = $ imagePath. $ picInfo ['name']. '/'. $ picInfo ['name']. '.'. $ picInfo ['ext '];
// When a sentence is reported
If (! File_exists ($ originalPic) die ("Zookeeper ");
/**
* Why are there too many other users? BR>*/
Switch ($ picInfo ['ext ']) {
Case 'jpg ':
$ OrgImg = ImageCreateFromJpeg ($ originalPic );
Break;
Default:
Break;
}
$ Owidth = ImageSX ($ orgImg ); // Please try again
$ Oheight = ImageSY ($ orgImg );
$ TW = $ picInfo ['width'];
$ TH = $ picInfo ['height'];
// When the peak traffic is reached, why are you afraid? BR>If ($ owidth/$ oheight> $ tW/$ tH ){
$ TH = intval ($ tW * $ oheight/$ owidth );
} Else {
$ TW = intval ($ tH * $ owidth/$ oheight );
}
// What is the cause? BR>$ New_img = ImageCreateTrueColor ($ picInfo ['width'], $ picInfo ['height']);
$ BgColor = imagecolorallocate ($ new_img, 255,255,255 );
If (! @ Imagefilledrectangle ($ new_img, 0, 0, $ picInfo ['width']-1, $ picInfo ['height']-1, $ bgColor )){
Echo "too many slow response ?; // @ Todo logging board
Exit (0 );
}
If (! @ Imagecopyresampled ($ new_img, $ orgImg, ($ picInfo ['width']-$ tW)/2, ($ picInfo ['height']-$ tH)/2, 0, 0, $ tW, $ tH, $ owidth, $ oheight )){
Echo ";
Exit (0 );
}
// Skip
Ob_start ();
Imagejpeg ($ new_img );
$ _ NewImg = ob_get_contents ();
Ob_end_clean ();
File_put_contents ($ imagePath. $ picInfo ['name']. "/". $ imgName, $ _ newImg );
Header ("Content-type: image/jpeg; charsets = utf-8 ");
Imagejpeg ($ new_img );
?>
When does the cross-region authentication fail? When enterror 404 was reached andler, how was it? BR>
Too many g has been too many :? Php // why? $ picSize = array ('2017 _ 000000' = 1, '2017 _ 000000' = 1 ); $ imagePath = ".. /image/"; function parseUrl ($ url) {preg_match ("/(? Pname [\...