xuexue 15 Junior Poster

the program works with localhost, however, when i use the same program in my web server, it does not work, the error says: Error Uploading file,

this is the code

$phType = $_POST['phType'];
$phCustomer = $_POST['phCustomer'];
$phModel = $_POST['phModel'];
$phStatus = $_POST['phStatus'];
$phDateDue = $_POST['phDateDue'];  						
$phStatus = $_POST['phStatus'];
$phNG = $_POST['phNG'];
$phCIR = $_POST['phCIR'];
$phCMR = $_POST['phCMR'];
$upload = $_POST['upload'];

$phName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$phSize = $_FILES['userfile']['size'];
$uploadDir ="data/main menu/Problem History/";
$filePath = $uploadDir . $phName;

echo "<br><br><b>You are required to key-in data in all blank fields.<br> Click the upload button below once you have completed all requirements.<br>If the there will be no data to be inputted just type 

'NONE'.<br></b>";
echo "<form method='post' enctype='multipart/form-data'>";
echo "<b>Type:</b><br><input type = 'text' name = 'phType' size = 30><br>";
echo "<b>Customer:</b> <br><input type = 'text' name = 'phCustomer' size = 70><br>";
echo "<b>Model:</b> <br><input type = 'text' name = 'phModel' size =50><br>";
$phSubDate = date("F d Y");
echo "<b>Date Due: </b><b><font size = 1>(Please change if necessary)</font></b> <br><input type = 'text' name = 'phDateDue' size =50 value = '$phSubDate'><br>";
echo "<b>Status: </b><br><input type = 'text' name = 'phStatus' size =50><br>";
echo "<b>NG Category: </b><br><input type = 'text' name = 'phNG' size =50><br>";
echo "<b>CIR No.:</b> <br><input type = 'text' name = 'phCIR' size =50><br>";
echo "<b>CMR No.: </b><br><input type = 'text' name = 'phCMR' size =50><br>"; 
echo "<input type='hidden' name='MAX_FILE_SIZE' value='100000000'>";
echo "<br>Press browse to select what file to upload:<br> <input name='userfile' type='file' id='userfile'>";
echo "<br><input name='upload' type='submit' class='box' id='upload' value='Upload'></form>";
echo "</form>";

function size_hum_read($size)
{ 
	$i=0; 
	$iec = array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); 
	while (($size/1024)>1) 
	{ 
		$size=$size/1024; 
		$i++; 
	} 
	return substr($size,0,strpos($size,'.')+4).$iec[$i]; 
} 

if ($upload == 'Upload')
{
	if ($phType == '' || $phCustomer == '' || $phModel == '' || $phDateDue == '' || $phStatus == '' || $phNG == '' || $phCIR == '' || $phCMR == '') 
	{
		echo "<script>alert('Please complete the information!')</script>";
	}
	else if ($phType != '' || $phCustomer != '' || $phModel != '' || $phDateDue != '' || $phStatus != '' || $phNG != '' || $phCIR != '' || $phCMR != '')
	{								
		$result = move_uploaded_file($tmpName, $filePath);
		
		if (!$result) 
		{
			echo "<script>alert('Error Uploading File!')</script>";
			exit;
		}
		if(!get_magic_quotes_gpc())
		{
			$phName = addslashes($phName);
			$filePath = addslashes($filePath);
		} 
	
		$phSize =  size_hum_read(filesize($filePath)); 

		$result1 = mysql_query("SELECT * FROM sec_ph WHERE phName = '$phName'") or die(mysql_error()); 
		$resultRow1 = mysql_num_rows($result1);
			
		if ($resultRow1 == '0')
		{
			$phDateSubmit = date("F d Y");

			mysql_query("INSERT INTO sec_ph (phName, phType, phCustomer, phModel, phStatus, phNG, phCIR, phCMR, phFlag, phDateSubmit,phDateDue) 
					VALUES ('$phName','$phType', '$phCustomer','$phModel','$phStatus','$phNG','$phCIR','$phCMR', '0', '$phDateSumit','$phDateDue')") 
						or die(mysql_error());  

			echo "<script>alert('Uploading of file successful')</script>";
		}
		else if ($resultRow1 != '0')
		{
			echo "<script>alert('File already exists! Please try again')</script>";			
		}
	}
}

let's say: that the ip address of my web xxx.xxx.xxx.xxx

please help me...