Sorry, I really hate the output of the<?php
//...
if ($_FILES['pic'.$i]['name']!=""){ //if there was input
$info = @getimagesize($_FILES['pic'.$i]['tmp_name']);
if ($info[2]==2) {
if (move_uploaded_file($_FILES['pic'.$i]['tmp_name'], "../pics/".$album_name."/".$_FILES['pic'.$i]['name'])){
chmod("../pics/".$album_name."/".$_FILES['pic'.$i]['name'], 0777);
mysql_query("INSERT INTO `pictures` (`url`, `album`, `date`) VALUES ('/pics/".$album_name."/".$_FILES['pic'.$i]['name']."', '".$album."',".$date.")", $db) or die (mysql_error());
}
else { die("Cannot upload file"); }
}
else{
die ("ALL PICS MUST BE .JPG or .JPEG! Please go back and fix it");
}
}
//...
?>
Code: Select all
tags.
Thanks!