CHMOD - My company's host is Windows. HELP!

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

CHMOD - My company's host is Windows. HELP!

Post by $var »

Hello,

I am still pretty new to programming,
so I haven't been exposed to the differences between servers,
and I am beginning to realize that some of the scripts that I've used,
aren't peforming the same.

I have this upload script, but I am having problems with server permissions,
and I can just imagine that I am going to hit more blocks with the rest of the server commands.

Code: Select all

if($_POST["bpress"]=="delete")
	{
		$sql = "DELETE FROM BandDJ WHERE BandDJID=".$ID;
		if(!$result = mysql_query($sql))
		{
			echo mysql_error();
		}
		@ chdir ($path)
			or die ("Cannot set the current working directory to <i>$path</i>.");
		for($x = 0; $x < $numimages; $x++)
      	{
      		@unlink($imagearray[$x]);
      	}
      	@ chdir ($_SERVER['DOCUMENT_ROOT']."/toronto/BandDJ")
      		or die ("Cannot set the current working directory to <i>$path</i>.");
		@rmdir($path) or die('Folder '.$path.' couldn\'t be deleted!');
		header("Location: http://www.20hzmusic.com/");
		exit;
	}

The rmdir and chdir are linux right? Is there a huge difference?
Do I need a different code for a Windows machine?
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post by ambivalent »

rmdir is a Linux command but chdir isn't - that would be "cd". That shouldn't matter though because they are both valid PHP functions and should work the same way on Linux or Windows machines. The problem must be elsewhere. It may sound trivial, but check to see if the target directory exists. What is the error message?
Post Reply