Hey guys sorry to b a pain again but this isn't workin now, all the thing is meant to do is write the file to the folder but it seems to ignore the variable $shop and just places it in the folder 'focus'. As can be seen $shop represents a folder, the folder is correctly chmod 0777 so any ideas of why its screwed?
PHP:
<?php
if($File){
print("<TR><TD colspan=2>File name:$File_name</TD></TR>");
print("<TR><TD colspan=2>File size:$File_size</TD></TR>");
opendir("php/form_data/focus/".$shop);
if(copy($File, "php/form_data/focus/$shop/$File_name")){
mail("lyonclan@onetel.net.uk", "new focus images", $File_name);
print("<TR><TD colspan=2>Your file, $File_name, was successfully uploaded!</TD></TR>");
}else{
print("<TR><TD colspan=2>Your file, $File_name, could not be copied.</TD></TR>");
}
unlink($File);
}
print("<center>
<table cellspacing=0 cellpadding=0 width=540 border=0>
<TR><TD colspan=2>Please remember you need to have filled in your details prior to submitting information else an error will occur. If you haven't already filled out your details please do so now. Please upload any documents and images you have related to your spotlight month. If you are returning and have entered your details previously you will be able to add files to your directory.<BR><BR>
<TR><TD colpsan=2> </TD></TR>
<TR><TD>Validation Code Sent Via Email:
<TD><input type=text name=shop size=28 class=box></TD>
<TR><TD><form action=\"?id=spotlight_upload\" method=post enctype=\"multipart/form-data\">File:
<TD><input type=file name=File size=28 class=box>
<TR><TD><input type=hidden name=MAX_FILE_SIZE value=1000000>
<TR><TD colspan=2><BR><BR><center><input type=submit name=\"submit\" value=Submit! class=box></form>
</TABLE>");
?>
The code shouldn't be too sketchy but it is an open upload due to the fact I need it to accept .doc .txt and all images. Does anyone know how to restrict it for this!!!
Any help is greatly appreciated
Andy