$sid,'expire'=>time() + Config::get('session_length')); $string = ''; return $string; } // form_register /** * form_verify * This takes a form name and then compares it with the posted sid, if they don't match * then it returns false and doesn't let the person continue */ public static function form_verify($name,$method='post') { switch ($method) { case 'post': $source = $_POST['form_validation']; break; case 'get': $source = $_GET['form_validation']; break; case 'cookie': $source = $_COOKIE['form_validation']; break; case 'request': $source = $_REQUEST['form_validation']; break; } if ($source == $_SESSION['forms'][$name]['sid'] AND $_SESSION['forms'][$name]['expire'] > time()) { unset($_SESSION['forms'][$name]); return true; } unset($_SESSION['forms'][$name]); return false; } // form_verify /** * image_dimensions * This returns the dimensions of the passed song of the passed type * returns an empty array if PHP-GD is not currently installed, returns * false on error */ public static function image_dimensions($image_data) { if (!function_exists('ImageCreateFromString')) { return false; } $image = ImageCreateFromString($image_data); if (!$image) { return false; } $width = imagesx($image); $height = imagesy($image); if (!$width || !$height) { return false; } return array('width'=>$width,'height'=>$height); } // image_dimensions } // Core ?>