示例#1
0
	function d3download_category_form_validate()
	{
		$result   = '' ;
		$imgurl   = ( ! empty( $_GET['imgurl'] ) ) ?   @$_GET['imgurl']   : '' ;
		$shotsdir = ( ! empty( $_GET['shotsdir'] ) ) ? @$_GET['shotsdir'] : '' ;

		require_once dirname( dirname(__FILE__) ).'/class/post_check.php' ;
		$post_check = new Post_Check() ;

		switch( true ) {
			case ( ! empty( $imgurl ) ) :
				if( $imgurl != 'http://' ) {
					if ( ! $post_check->imgurlCheck( $imgurl ) ) $result = 'invalid' ;
				}
				break ;
			case ( ! empty( $shotsdir ) ) :
				$cate_shotsdir = XOOPS_ROOT_PATH.'/'.$shotsdir ;
				if ( ! $post_check->fileexistsCheck( $cate_shotsdir ) ) $result = 'invalid' ;
				break ;
		}
		echo $result ;
	}