<?php 
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $src = 'google.png';
    require 'ImageManipulation.php';
    $objImage = new ImageManipulation($src);
    if ($objImage->imageok) {
        $objImage->setCrop($_POST['x'], $_POST['y'], $_POST['w'], $_POST['h']);
        $objImage->resize(500);
        $objImage->show();
        // uncomment the following line to save the output image.
        $objImage->save('12345.png');
    } else {
        echo 'Error!';
    }
    exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>-->
    <!--<script src="jquery.Jcrop.pack.js" type="text/javascript"></script>-->
	
	<script src="./js/jquery.min.js" type="text/javascript"></script>
    <script src="./js/jquery.Jcrop.js" type="text/javascript"></script>
    <script src="./js/jquery.color.js" type="text/javascript"></script>
    <link rel="stylesheet" href="./css/jquery.Jcrop.css" type="text/css" />
    <link rel="stylesheet" href="./css/jquery.Jcrop.extras.css" type="text/css" />
    <!--<link rel="stylesheet" href="demo_files/demos.css" type="text/css" />-->