Location: PHPKode > projects > infoboard > infoboard/_req/saveslide.php
<?
session_start();
include("../data/connect.php");
include("../data/_uconfig.php");
include("../_class/lang.php");
include("../_class/lang_".$iscon["getlang"].".php");

include("../_class/_func.php");
include("../_class/class.global.php");
include("../_class/class.req.php");

$infoboard = new req_infoboard();
$infoboard->checksess();
$infoboard->adminsess();

$data="";
for($i=1;$i<=$_POST["total"]; $i++){
	$picname=$_POST["cid".$i];
	if(!$picname) $picname=rand(0,999).time();
	 if(isset($_FILES["image".$i]["size"])){
		  if($_FILES["image".$i]["size"]){
			   $ext = strtolower($infoboard->getlast($_FILES["image".$i]["name"]));
			   if($ext == "jpg"){
				    $picname=rand(0,999).time();
				    if(move_uploaded_file($_FILES["image".$i]["tmp_name"], "../data/slide/".$picname.".".$ext)){
						 if(trim($_POST["cid".$i])){
							    if(file_exists("../data/slide/".$_POST["cid".$i].".jpg")) unlink("../data/slide/".$_POST["cid".$i].".jpg");
						 }
					}else{
						 $picname=$_POST["cid".$i];
					}
			   }
		  }
	 }
	 $data.=$picname."_|_".trim($_POST["title".$i])."\n";
}

if($data) $infoboard->iswrite("../data/slideshow.dat", $data);

refurl("", $_SERVER['HTTP_REFERER']);

?>
Return current item: infoboard