PHP application form will not upload file?

mat j

New member
I am working on an employee application form. I need to just get something up for now while I build my MySQL Database. I recently ran into a snag however.

How I want it to work is, I've created a Word document form that people can download. They fill it out and then I've build a sort of drop box for them to submit the word document. This document will then be taken stored in a directory on my client's server until it is read and deleted by one of our representatives.

Pretty simple coding, but for some reason my clients server is won't let me upload a file to it. I've given write access to the folder and manually set the PHP to accept uploads, but it is still not working. I built a bunch of catches into my code to find where it was getting stuck and its AT the upload part. Here is my code so far.

if(isset($_POST['empap'])){

if(!$_FILES['uploaded'] || !$_POST['nam_fi'] || !$_POST['nam_la']){$msg= '<script language="Javascript">alert ("1 THERE WAS A PROBLEM SENDING THE FORM PLEASE CALL 800-XXX-XXXX")</script>';}
elseif($_FILES['uploaded']['size'] < 250000 && $_FILES["uploaded"]["name"]=="examp.doc")
{

$stamp= time();
$name=$_POST['nam_fi'].$_POST['nam_la'];
$add=$name.$stamp;
$loc='4ppl1c4t10n/';
$target=$loc.$add;
$process=move_uploaded_file($_FILES['uploaded']['tmp_name'], "$target".$_FILES['uploaded']['name']);
if(!$process){
$msg= '<script language="Javascript">alert ("3 THERE WAS A PROBLEM SENDING THE FORM PLEASE CALL 800-XXX-XXXX")</script>';
}else
{....
and then it goes into a mail script and other stuff that i've tested independently and found that it works.
I always get error message 3 THERE WAS A PROBLEM SENDING THE FORM PLEASE CALL 800-XXX-XXXX

when I try to get it to echo the file type and tmp name they come up blank. When I get it to echo the file size it always says 0kb. I'm really confused and not sure what is going on.
I set the upload limit to 1mb already, and the files i'm uploading are only 150-300 kb.
 
You might want to check the file upload max size on your web hosting because theres a limit on how big the file size can be uploaded to the server.
 
Back
Top