iNFERiON I put in your code and mod it to fit my design which i have to say my coding is not good at all, but when i run the app it creates a directory in my images directory but in my thumbnail directory. Now i just want everybody to know that I am a really new web programmer and have been programming c++ for about a year because my engineering major required it for some odd reason.
so this is what my code looks like so far
<?php
include("config.inc.php");
//include("functions.inc.php");
$category_name = $_POST['category_name'];
function add_category( $category_name, $images_dir )
{
// Check to see if there is a directory with that name and delete it
if(is_dir($category_name)) {
echo "Removing $dir<br>";
rmdir($category_name);
}
// If directory gone, create it
if(!is_dir($category_name)) {
echo "Creating $dir<br>";
mysql_query( "INSERT INTO gallery_category(`category_name`) VALUES('".addslashes( $category_name )."')" );
$create = mkdir($images_dir . "/" . $category_name, 0700);
$create2 = mkdir($thumbs_dir . "/" . $category_name, 0700);
if(!$create || !$create2) {
if(!$create) {
echo "Could not create directory! " . $category_name . " in the " . $images_dir . "folder";
}
if(!$create2) {
echo "Could not create directory! " . $category_name . " in the " . $thumbs_dir . "folder";
}
}
}
}
// Call: add_category( “Category Name” );
add_category( $category_name, $images_dir );
$result_final .= "The category " . "\"" . $category_name . "\"" . " was created successfully.";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Picture upload</title>
</head>
<body>
<?php echo $result_final; ?>
<a href="index.php">Back to Gallery</a>
</body>
</html>