<?php
require_once(dirname(__FILE__)."/../../inc/common.inc.php");	//核心文件
if($action=='copyimg'){
	$string=",";
	$updir||$updir="upimg";
	$i=0;
	foreach($upimgnum AS $key=>$value){
		$thispicur="picurl".$value;
		$picurl=$_POST[$thispicur];
		if($picurl!=''){
			$i++;
			$strcode = file_get_contents($picurl);
			$name = $lfjuid.'_'.rands(4).'_'.$timestamp.'.jpg';
			if(!is_dir(ROOT_PATH."$webdb[updir]/$updir")){
				makepath(ROOT_PATH."$webdb[updir]/$updir");
			}
			write_file(ROOT_PATH."$webdb[updir]/$updir/$name",$strcode);
			$imgsrt=($i==1)?"$updir/$name":",$updir/$name";
			$string.=$imgsrt;
		}
	}
	if($string==","){
		refreshto("?updir=$updir","没有上传任何图片",100);
	}else{
		echo "<script>
					window.parent.upimg1(\"$string\");
			 </script>";
		exit;
	}
}
require("img.htm");
?>