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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.