I have the following script below which calls up either a mailform or a submit file form . Works fine in IE but in Netscape does not copy the files to the new directory.
I have included code for the mainfile and the submit file file to aid you excellent people providing me with help.
MAIN FILE CODE
<?
if ($action=="insertfile")
{
include ("file-upload.php3");
}
if ($action=="mail")
{
if ($realname == "" || ($email == ""))
{
echo "<h2>Please check that you have completed all neccessary details</h2>";
include ("mailform.php3");
}
else
{
if ($sendmail=='Send')
{
// SEND THE MAIL - THE BASIC WAY - NEED TO USE HTTP_GET_VARS
mail("$recipient", "File Submission - check //photo/transfer/uploads/", "From: $realname\nEmail: $email\nCompany: $Company\nStreet: $Street\nSuburb: $Suburb\nPostcode: $postcode State: $State\nPhone: $BHphone\nFax: $Fax\n Instructions: $instructions");
$name = strip_tags($realname);
include ("file-upload.php3");
}
}
}
if (!$action)
{
include ("mailform.php3");
}
?>
<?
include ("template/medillbottom.inc");
?>
SUBMIT FILE CODE
<?
if (!file_exists("d:/Production/Transfer/Uploads/$realname"))
{
// CREATE THE DIRECTORY
mkdir("d:/Production/Transfer/Uploads/$realname", 0777);
}
//else
//{
//$DOCUMENT_ROOT = basename("d:/Production/Transfer/Uploads/$realname");
//}
//print $DOCUMENT_ROOT;
?>
<table width="599" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="438">
<h1>File Submission - Part 2</h1>
<FORM ENCTYPE="multipart/form-data" ACTION="<? $PHP_SELF; ?>" METHOD='POST' name="give">
<?
//CONDITION TO DISPLAY INITIAL MESSAGE
if ($action != "insertfile") {
echo "<p>$realname browse for the file(s) you wish to upload and click send. A confirmation
message will appear.</p>"; }?> <BR>
<INPUT NAME="userfile" TYPE="file" SIZE=30>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="9000000000">
<input type="submit" value="Send" name="send">
<br>
<br>
<INPUT TYPE="HIDDEN" NAME="action" VALUE="insertfile">
<br>
<?
if ($action == "insertfile") {
$dat = date("U");
$handle = chdir("d:/Production/Transfer/Uploads/$realname");
$newfile= strip_tags($userfile_name);
$file = ($handle) .$newfile;
if (copy($userfile, $file))
{
echo "<p>$userfile_name was uploaded successfully</p>";
chdir($DOCUMENT_ROOT);
}
}
?>