Hi:
I was testing my upload form page: <http://www.epgusa.com/uploadform.html>
and received the following error message:
Parse error: syntax error, unexpected ':' in /home2/epguacom/public_html/uploadaction.php on line 35
My php code is below. What needs to be changed?
I await your response.
Dween Bean
<?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 >20000000)
{
//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.epgusa.com/uploads/".$upload_Name ;
}
//Sending Email to form owner
$mailto = "youremail@yourdomain.com";
$mailsubj = "Your Uploaded Photo/s";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Thank you for uploading your photo/s to Electric Paintbrush Gallery":\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 was testing my upload form page: <http://www.epgusa.com/uploadform.html>
and received the following error message:
Parse error: syntax error, unexpected ':' in /home2/epguacom/public_html/uploadaction.php on line 35
My php code is below. What needs to be changed?
I await your response.
Dween Bean
<?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 >20000000)
{
//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.epgusa.com/uploads/".$upload_Name ;
}
//Sending Email to form owner
$mailto = "youremail@yourdomain.com";
$mailsubj = "Your Uploaded Photo/s";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Thank you for uploading your photo/s to Electric Paintbrush Gallery":\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");
?>
Comment