Размер файла: 1.79Kb
<?php
#---------------------------------------------------#
# #
# ********* AgS DOWNLOAD centre 1.0 ********* #
# #
# Author : Agris Cišs #
# E-mail : [email protected] #
# WAP-site : http://ags.h2m.ru #
# Home : LATVIA J-city #
# #
# Don't sell the skript! #
# If you do it, I will hit to your face! :D #
# #
#---------------------------------------------------#
include "sys/cons.php";
include "sys/cepumi.php";
include "sys/funct.php";
include "sys/lang/$language.php";
//include "sys/msg.php";
@$fails = $_GET["fails"];
@$h = parbaude($_GET["h"]);
@$w = parbaude($_GET["w"]);
if(preg_match("[http]",$fails)) exit("Kļūda!");
if(preg_match("[\.\.]",$fails)) exit("Kļūda!");
if(preg_match("[%]",$fails)) exit("Kļūda!");
if($h > 500 or $w > 500) {header ("Location: index.php?msg=bigwh&"); exit;}
if(preg_match("[\.png]",$fails) or preg_match("[\.PNG]",$fails)) {
$old = imagecreatefrompng("$fails");
} elseif(preg_match("[\.gif]",$fails) or preg_match("[\.GIF]",$fails)) {
$old = imagecreatefromgif("$fails");
} elseif(preg_match("[\.jpg]",$fails) or preg_match("[\.JPG]",$fails)) {
$old = imagecreatefromjpeg("$fails");
}
$weight = imageSX($old);
$height = imageSY($old);
if($h) {
$wn = $w;
$hn = $h;
} else {
$wn = AUGSTUMS;
$hn = AUGSTUMS;
}
$new = imagecreatetruecolor($wn, $hn);
imageCopyResized($new, $old, 0, 0, 0, 0, $wn, $hn, $weight, $height);
Header("Content-type: image/jpeg");
imagejpeg($new);
?>