<?php
 
    if($_GET['from']==""){
 
        //missing hex value;
 
        exit;
 
    }
 
    if($_GET['to']==""){
 
        //missing hex value;
 
        exit;
 
    }
 
    if($_GET['w']==""){
 
        //missing width value;
 
        exit;
 
      }
 
    if($_GET['h']==""){
 
        //missing width value;
 
        exit;
 
      }
 
 
    
 
    require "class.gradient_image.php";
 
 
    $fade_from=$_GET['from'];
 
    $fade_to=$_GET['to'];  
 
         
 
    $width= $_GET['w'];
 
    
 
    $height= $_GET['h'];
 
    
 
    $direction= $_GET['d'];
 
    if ($direction=='true') {
 
        $direction=true;
 
    } else {
 
        $direction=false;
 
    }
 
 
    function Is_OddNum($num){
 
        if ($num % 2) {
 
            return true;
 
        } else {
 
            return false;
 
        }
 
    }
 
    
 
    $mod = $height;
 
    if (Is_OddNum($mod)) $mod--;
 
       
 
    $steps=$mod / 2;
 
    
 
    $gradient = new gradient_image($fade_from, $fade_to, $steps, $width, $height);
 
    $im = $gradient->createImage($direction);
 
    $gradient->createPNG($im, true);
 
 
?>
 
 |