mkdir() not creating directory........why......

I don’t understand what could be causing this not to work…every other sample code I have found online has pretty much matched this. I am using an apache server running on localhost. I don’t know if I’m specifying the wrong location somehow or what…any ideas?

[php]if(!is_dir("/Uploads")){
mkdir("/Uploads");

	if(!is_dir("Uploads")){
		echo "<script>alert('dir not created')</script>";
		die();
	}
	else{
	echo "<script>alert('dir created')</script>";
	}	[/php]

ok I can’t figure out how to edit a post…but just in addition to my post…it’s not missing the end ‘}’ I just didn’t copy it on accident.

I doesn’t dcreate it or you get ‘dir not created’?

Do you see a differernce here:
if(!is_dir("/Uploads")){

	if(!is_dir("Uploads")){

Also, use:
[php]error_reporting(E_ALL);
ini_set(‘display_errors’, ‘1’);[/php]

It still doesn’t create and I get ‘dir not created’.

Sponsor our Newsletter | Privacy Policy | Terms of Service