Jump to content

[SOLVED] Creating a Directory


The14thGOD

Recommended Posts

I'm trying to create a directory if the user needs to create a new category for something. I looked here: http://www.php.net/manual/en/function.mkdir.php and I still can't seem to get it to work. I've got this right now:

<?php if($newcategory) {
			mkdir("..\images\$newcategory",0777);
			$uploaddir = "../images/$newcategory/";?>

It just created the directory "..\images$newcategory" in the same folder as the script. I'm guessing that the \ in front of the $ is just making it ignore the variable so it's not parsing it. Anyone know how to make the directory so it goes back one folder?

The server is using PHP 4.4.4 if that helps and running on Linux.

 

Thanks for any help.

 

Justin

Link to comment
https://forums.phpfreaks.com/topic/104968-solved-creating-a-directory/
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.