fork download
  1. <?php
  2. header('Content-type: image/jpeg');
  3. error_reporting(E_ALL ^ E_DEPRECATED);
  4.  
  5. $gain = $_GET["gain"];
  6. $diameter = $_GET["diameter"];
  7. $frequency = $_GET["frequency"];
  8. $degreeNeg = $_GET["degreeNeg"]; if($degreeNeg<0) $degreeNeg = -$degreeNeg;
  9. $degreePos = $_GET["degreePos"]; if($degreePos<0) $degreePos = -$degreePos;
  10. $efficiency = 60;
  11. $gain_n = $_GET["gain_n"]; if($gain_n==null) $gain_n=0;
  12. $c = $_GET["c"];
  13. $checkSTD = 0;
  14. $array_std = array();
  15.  
  16.  
  17.  
  18. $x1 = $_POST["x1"];
  19. $x2 = $_POST["x2"];
  20. $y1 = $_POST["y1"];
  21. $y2 = $_POST["y2"];
  22. $width = $_POST["w"];
  23. $height = $_POST["h"];
  24. $pic = $_GET["pic"];
  25.  
  26. $img_r = imagecreatefromjpeg("../Ant/uploads/".$pic);
  27. $dst_r = ImageCreateTrueColor($width, $height );
  28.  
  29. $newfilename = '../Ant/uploads/crop-pic.jpg';
  30.  
  31. imagecopyresampled($dst_r,$img_r,0,0,$x1,$y1,$width,$height,$width,$height);
  32.  
  33.  
  34. //$destination = '../Ant/uploads';
  35. imagejpeg($dst_r,$newfilename,100);
  36.  
  37. echo"<script language=\"JavaScript\">";
  38. echo"alert('test')";
  39. echo"</script>";
  40. //$url = htmlspecialchars($_SERVER['HTTP_REFERER']);
  41. //echo "<a href=\"javascript:history.go(-1)\">GO BACK</a>";
  42.  
  43. //header("Location: " . $_SERVER["HTTP_REFERER"])
  44. /*<a href="graph.php?gain=<?php echo $gain; ?>&diameter=<?php echo $diameter; ?>&frequency=<?php echo $frequency; ?>&degreeNeg=<?php echo $degreeNeg; ?>&degreePos=<?php echo $degreePos; ?>&gain_n=<?php echo $gain_n; ?>&gain_max=<?php echo $gain_max; ?>&gain_min=<?php echo $gain_min; ?>&c=<?php echo $c; ?>&<?php echo http_build_query($array_std); ?>">*/
  45. //header('Content-Disposition: attachment; filename="crop-pic.jpg"');
  46. ?>
Runtime error #stdin #stdout #stderr 0.02s 52472KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined index: gain in /home/udMQkp/prog.php on line 5
PHP Notice:  Undefined index: diameter in /home/udMQkp/prog.php on line 6
PHP Notice:  Undefined index: frequency in /home/udMQkp/prog.php on line 7
PHP Notice:  Undefined index: degreeNeg in /home/udMQkp/prog.php on line 8
PHP Notice:  Undefined index: degreePos in /home/udMQkp/prog.php on line 9
PHP Notice:  Undefined index: gain_n in /home/udMQkp/prog.php on line 11
PHP Notice:  Undefined index: c in /home/udMQkp/prog.php on line 12
PHP Notice:  Undefined index: x1 in /home/udMQkp/prog.php on line 18
PHP Notice:  Undefined index: x2 in /home/udMQkp/prog.php on line 19
PHP Notice:  Undefined index: y1 in /home/udMQkp/prog.php on line 20
PHP Notice:  Undefined index: y2 in /home/udMQkp/prog.php on line 21
PHP Notice:  Undefined index: w in /home/udMQkp/prog.php on line 22
PHP Notice:  Undefined index: h in /home/udMQkp/prog.php on line 23
PHP Notice:  Undefined index: pic in /home/udMQkp/prog.php on line 24
PHP Fatal error:  Call to undefined function imagecreatefromjpeg() in /home/udMQkp/prog.php on line 26