here's the code, this one goes well with localhost and it's functioning, however, when i tried it using a web server, it says error uploading file, what do you think is the problem? please help...
$phName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$phSize = $_FILES['userfile']['size'];
$uploadDir ="10.237.102.158/upload/joomla/";
$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>";
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, phPath)
VALUES ('$phName','$phType', '$phCustomer','$phModel','$phStatus','$phNG','$phCIR','$phCMR', '0',
'$phDateSumit','$phDateDue', '$uploadDir')")
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>";
}
}
}
Note: I am using the Samba server and it has username and password in order to access the said server..
thanks thanks,
need reply asap...^^