Jump to content

uploading a file


rdkd1970

Recommended Posts

I am working on making an album however I am not sure where I am going wrong with my codes. I have an upload and thumbs folder in the albums folder but I keep getting this message....

 

Warning: mkdir() [function.mkdir]: File exists in /home/ebermy5/public_html/albums/album_func.php on line 44

 

Warning: mkdir() [function.mkdir]: File exists in /home/ebermy5/public_html/albums/album_func.php on line 45

 

Warning: Cannot modify header information - headers already sent by (output started at /home/ebermy5/public_html/albums/create_album.php:9) in /home/ebermy5/public_html/albums/create_album.php on line 29

 

Codes: for line 44 and 45

function create_album($album_name, $album_description){
$album_name = mysql_real_escape_string(htmlentities($album_name));
$album_description = mysql_real_escape_string(htmlentities($album_description));

mysql_query("INSERT INTO `albums` VALUES ('', '".$_SESSION['SESS_ID']."', UNIX_TIMESTAMP(), `$album_name`,`$album_description`)");
mkdir('uploads/'.mysql_insert_id(), 0744);
mkdir('uploads/thumbs/'.mysql_insert_id(), 0744);
}

 

Code: for line 29

if(isset($_POST['album_name'], $_POST['album_description'])){
$album_name = $_POST['album_name'];
$album_description = $_POST['album_description'];

$errors = "";

if(empty($album_name) || empty($album_description)){
	$errors = 'Album name and description required';
}else{
	if(strlen($album_name) > 55 || strlen($album_description) > 255){
		$errors = 'One or more fields contains too many characters';
		}
	}
	if(!empty($errors)){
		foreach($errors as $error){
			echo $errors, '<br />';
			}
		} else {
			create_album ($album_name, $album_description);
			header('Location: albums.php');
			exit();
			}
}

 

:shrug:

Link to comment
https://forums.phpfreaks.com/topic/250247-uploading-a-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.