I copied and pasted the code listed below. I followed all instructions as far as creating folder and php page, thanx and error... I tested the form out, I did a test upload and it seemed to be working but instead of getting a thanks page or an error page i got this:
Parse error: syntax error, unexpected '=' in
/home/myusername/public_html/upload.php on line
9
I replaced the correct directory path user name with "
myusername" just to protect the account... below is the code I used, Did I mess up with an extra '=' or something?
<?php
// Receiving variables
@$userfile_Name = $_FILES['userfile']['name'];
@$userfile_Size = $_FILES['userfile']['size'];
@$userfile_Temp = $_FILES['userfile']['tmp_name'];
@$userfile_Mime_Type = $_FILES['userfile']['type'];
@$Name = addslashes($_POST['Name']);
@$
E-mail = addslashes($_POST[
'E-mail']);
@$comment = addslashes($_POST['comment']);
function RecursiveMkdir($path)
{
if (!file_exists($path))
{
RecursiveMkdir(dirname($path));
mkdir($path, 0777);
}
}
if ($
userfile_Size>0)
{
// Validation
if( $userfile_Size == 0)
{
header("Location: errorpage.html");
exit;
}
if( $userfile_Size >100000)
{
//delete file
unlink($userfile_Temp);
header("Location: errorpage.html");
exit;
}
$uploadFile = "upload/".$userfile_Name ;
if (!is_dir(dirname($uploadFile)))
{
@RecursiveMkdir(dirname($uploadFile));
}
else
{
@chmod(dirname($uploadFile), 0777);
}
@move_uploaded_file( $userfile_Temp , $uploadFile);
chmod($uploadFile, 0644);
$userfile_URL = "<A href="http://www.lost-angelz.com/upload/".$userfile_Name">http://www.lost-angelz.com/upload/".$userfile_Name ;
}
//Sending Email to form owner
$pfw_header = "From: $
E-mail\n"
. "Reply-To: $
E-mail\n";
$pfw_subject = "New File Upload";
$pfw_email_to = "mye-mail
@lost-angelz.com";
$pfw_message = "There is a new file uploaded.\n"
. "-----------------------------------\n"
. "File Link: $userfile_URL\n"
. "Name: $Name\n"
. "E-mail: $
E-mail\n"
. "Comment: $comment\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: thankyoupage.html");
?>