I made an upload button that sends a file to my /public_html/uploads
folder, but nothing is showing up there.
this is the code Im using
<?php
// Receiving variables
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
// Validation for max file size
if ($upload_Size>0)
{
if( $upload_Size >1000)
{
//delete file
unlink($upload_Temp);
header("Location: error.html");
exit;
}
$uploadFile = "uploads/".$upload_Name ;
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = "http://www.me3ddd.com/uploads/".$upload_Name ;
}
//Sending Email to form owner
$mailto = "sales@me3ddd.com";
$mailsubj = "Logo Upload";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Your Logo was uploaded successfully :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
$mailbody .= "upload: $upload_URL\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou_page.html");
?>
I followed everything from the tutorial.
folder, but nothing is showing up there.
this is the code Im using
<?php
// Receiving variables
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
// Validation for max file size
if ($upload_Size>0)
{
if( $upload_Size >1000)
{
//delete file
unlink($upload_Temp);
header("Location: error.html");
exit;
}
$uploadFile = "uploads/".$upload_Name ;
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = "http://www.me3ddd.com/uploads/".$upload_Name ;
}
//Sending Email to form owner
$mailto = "sales@me3ddd.com";
$mailsubj = "Logo Upload";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Your Logo was uploaded successfully :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
$mailbody .= "upload: $upload_URL\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou_page.html");
?>
I followed everything from the tutorial.
Comment