I'm running php3 and I'm trying to perform a
multiple file upload through my html document using....
<input type="file" name="File1">
Inside my html code I allow the user to
upload up to 3 files, and then enter in
their personal information, ie, name,
address, etc. in the boxes I have input boxes defined such as...
<input type="text" name="Name"><br>
<input type="text" name="Address"><br>
My php3 script won't allow me to upload my files.
If I enter in the personal information into
my html document and do not try to upload
any files with the form, when I press submit
the data is transferred to my php3 script
properly and I can reference the variables such as $Name, $Address for later use.
But, if I attempt to upload a file/files with
this form and fill in the personal fields
I get the error 'unitialized variable' for
each variable I have.
The following is my php3 script.
<?php
/*************************************/
/ SET FILE UPLOAD DIRECTORY /
/*************************************/
$UploadDir "e:\inetpub\wwwroot\bct\wotw\";
/*************************************/
/ COPY UPLOADED FILES /
/*************************************/
$UploadFile1 = $UploadDir . $File1_name;
$UploadFile2 = $UploadDir . $File2_name;
$UploadFile3 = $UploadDir . $File3_name;
if ($File1 != "none")
{
copy ($File1, $UploadFile1);
}
if ($File2 != "none")
{
copy ($File2, $UploadFile2);
}
if ($File3 != "none")
{
copy ($File3, $UploadFile3);
}
/*************************************/
/ GET FIELD INFO AND SAVE TO VARIABLE /
/*************************************/
$sTemp = "";
$sTemp .= "File Name 1 : \t $File1_name \r";
$sTemp .= "Category 1 : \t $Category1 \r";
$sTemp .= "Synopsis 1 : \t $Synopsis1 \r\r";
$sTemp .= "File Name 2 : \t $File2_name \r";
$sTemp .= "Category 2 : \t $Category2 \r";
$sTemp .= "Synopsis 2 : \t $Synopsis2 \r\r";
$sTemp .= "File Name 3 : \t $File3_name \r";
$sTemp .= "Category 3 : \t $Category3 \r";
$sTemp .= "Synopsis 3 : \t $Synopsis3 \r\r";
$sTemp .= "Name : \t $Name \r";
$sTemp .= "Address : \t $Address \r";
$sTemp .= "City : \t $City \r";
$sTemp .= "State/Prov : \t $StateProv \r";
$sTemp .= "Zip/Postal : \t $ZipPostal \r";
$sTemp .= "Country : \t $Country \r";
$sTemp .= "Home Phone : \t $HomePhone \r";
$sTemp .= "Office Phone: \t $OfficePhone \r";
$sTemp .= "E-mail : \t $EmailAddress \r";
if (! empty($NoName))
{
$sTemp .= "No Name : \t $NoName \r";
}
else
{
$sTemp .= "No Name : \r";
}
$sTemp .= "AcceptTerms : \t $AcceptTerms \r";
if (! empty($DontAcceptTerm))
{
$sTemp .= "DontAccept : $DontAcceptTerms \r";
}
else
{
$sTemp .= "DontAccept : \r\r";
}
/*************************************/
/ CONSTRUCT & SEND EMAIL TO WOTW /
/*************************************/
/ $mailto = "info@writersontheweb.com"; /
$mailto = "kathyc@bserv.com";
$subject = "New File Submission";
$replyto = "Reply-To:";
mail ($mailto, $subject, $sTemp, $replyto);
/*************************************/
/ SEND A RETURN PAGE TO USER /
/*************************************/
print "\n";
print "<head>\n";
print "<title>Writers On The Web - Submission Reply</title>\n";
print "</head>\n\n";
print "<body topmargin=0 leftmargin=8 marginwidth=8 marginheight=0 background='http://writersontheweb.com/wotw_images/bckg4.gif'>\n\n";
print "<!! === GRAPHICS FOR WEB PAGE === !!>\n";
print "<table border=0 width=641 cellpadding=0 cellspacing=0>\n";
print "<tr>\n";
print " <td colspan=4>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/spacer.gif' width=641 height=7><br>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/top1.jpg' width=641 height=88></td>\n";
print "</tr>\n\n";
print "<tr>\n";
print " <td><img border=0 src='http://writersontheweb.com/wotw_images/top2a.jpg' width=124 height=32></td>\n";
print " <td width=18><img border=0 src='http://writersontheweb.com/wotw_images/top2b.jpg' width=18 height=32></td>\n";
print " <td width=473></td>\n";
print " <td align=right width=26><img border=0 src='http://writersontheweb.com/wotw_images/toprght.gif' width=26 height=32></td>\n";
print "</tr>\n\n";
print "<tr>\n";
print " <td width=124 valign=top>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/top3.gif' width=124 height=52><br>\n\n";
print " <a href='index.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b1a.gif' width=124 height=25><br></a>\n\n";
print " <a href='submit_submit.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b3b.gif' width=124 height=26><br></a>\n\n";
print " <a href='submit_category.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b11a.gif' width=124 height=26></a><br>\n\n";
print " <a href='submit_pricing.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b4a.gif' width=124 height=26></a><br>\n\n";
print " <a href='submit_contract.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b5a.gif' width=124 height=42><br></a>\n\n";
print " <a href='submit_faqs.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b10a.gif' width=124 height=26></a><br>\n\n";
print " <a href='submit_profile.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b6a.gif' width=124 height=26></a><br>\n\n";
print " <a href='submit_contact.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b7a.gif' width=124 height=22></a><br>\n\n";
print " <a href='home_abc.htm'>\n";
print " <img border=0 src='http://writersontheweb.com/wotw_images/b8a.gif' width=124 height=42></a><br><br>\n";
print " </td>\n\n";
print " <td width=517 colspan=3 valign=top align=center>\n\n";
print " <!! === SUBMISSION HEADING === !!>\n";
print " <table border=0 cellpadding=0 cellspacing=0 width=464>\n";
print " <tr>\n";
print " <td>\n";
print " <p align=center><img border=0 src='http://writersontheweb.com/wotw_images/hdsubfrm.gif' width=280 height=37></p>\n";
print " </td>\n";
print " </tr></table>\n\n";
print " <!! === THANK YOU FOR YOUR SUBMISSION == !!>\n";
print " <br><br>\n";
print " <table border=0 align=center cellpadding=0 cellspacing=0 width=464>\n";
print " <tr>\n";
print " <td align=center>\n";
print " <p><font face='Arial' size=3>\n";
print " Thank you for your submission<br>$Name.\n\n";
print " </font>\n\n";
print " </td>\n";
print " </tr></table>\n\n";
print " <!! === BOTTOM LINKS === !!>\n";
print " <div align=center>\n";
print " <center>\n\n";
print " <br><br><br><br>\n";
print " <table border=0 cellpadding=0 cellspacing=0 width=493>\n";
print " <tr>\n";
print " <td align=center><font color='#000000'>\n";
print " <a href='index.htm'><font size=1 face='Arial' color='#000000'>Home</font></a><font size='1' face='Arial'> \n";
print " | </font><a href='submit_submit.htm'><font size=1 face='Arial' color='#000000'>Submit</font></a><font size=1 face='Arial'> \n";
print " | </font></font><font size=1 face='Arial' color='#DB8400'>Submission\n";
print " Form </font><font color='#000000'><font size=1 face='Arial'>\n";
print " | </font><a href='submit_category.htm'><font size=1 face='Arial' color='#000000'>Categories</font></a><font size=1 face='Arial'> \n";
print " | </font><a href='submit_pricing.htm'><font size=1 face='Arial' color='#000000'>Pricing</font></a><font size=1 face='Arial'> \n";
print " | </font><a href='submit_contract.htm'><font size=1 face='Arial' color='#000000'>Submission\n";
print " Contract</font></a><font size=1 face='Arial'> </font></font><font size=1 face='Arial'>\n";
print " | </font><a href='submit_faqs.htm'><font size=1 face='Arial' color='#000000'>FAQ's</font></a><font size=1 face='Arial'> </font></td>\n";
print " </tr>\n\n";
print " <tr>\n";
print " <td align=center><font color='#000000'><font size=1 face='Arial'> </font><a href='submit_profile.htm'><font size=1 face='Arial' color='#000000'>About\n";
print " Us</font></a></font><font color='#808080'> </font><font size=1 face='Arial' color='#000000'> | \n";
print " </font><font color='#000000'><a href='submit_contact.htm'><font size=1 face='Arial' color='#000000'>Contact\n";
print " Us</font></a></font><font size=1 face='Arial'> </font><font size=1 face='Arial' color='#000000'> | \n";
print " </font><a href='home_writers.htm'><font size=1 face='Arial' color='#000000'>Writers\n";
print " on the Web</font></a><font size=1 face='Arial'> </font><font size=1 face='Arial' color='#000000'> | </font><font size=1 face='Arial'>\n";
print " </font><a href='home_abc.htm'><font size=1 face='Arial' color='#000000'>WritersABC\n";
print " Library</font></a>\n";
print " </td>\n";
print " </tr></table>\n\n";
print " </div>\n";
print " <p> \n";
print "</td>\n";
print "</tr></table>\n\n";
print "</body>\n";
print "\n";
/*************************************/
/ E N D O F F I L E /
/*************************************/
?>
I have tried absolutely everything I can
think of to try to make this work and it
won't.
Can someone please help me.