View Single Post
  #17  
Old 06-06-2006, 08:22 PM
bannacom's Avatar
bannacom bannacom is offline
Sergeant
 
Join Date: Jun 2006
Posts: 26
Default Re: video/image upload script?

i used above mentioned instruction and adjusted it for my needs. everything works great except last line "comment". i dont know where is the problem, there is no comment text in email. My form: http://www.bannerclickmania.com/form1.php



<?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']);
@$Email = addslashes($_POST['Email']);
@$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 >5000000)
{
//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 = "http://www.bannerclickmania.com/upload/".$userfile_Name ;
}

//Sending Email to form owner
$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "New File Upload";
$pfw_email_to = "addbanner@bannerclickmania.com";
$pfw_message = "There is a new file uploaded.\n"
. "-----------------------------------\n"
. "File Link: $userfile_URL\n"
. "Name: $name\n"
. "Email: $Email\n"
. "Webpage: $webpage\n"
. "Numbercell: $numbercell\n"
. "Micetext: $micetext\n"
. "Password: $password\n"
. "Comment: $comment\n";
*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: thankyoupage.html");
?>
Reply With Quote