Can anyone find a problem with this script it keeps on come up with this message after I press the submit button on the form.
Parse error: syntax error, unexpected T_STRING in /home2/wkillvi/public_html/uploadaction.php on line 13
I have four upload files and the last one is named (n) at first it was 3 but this didnt work either. The thanh_you page dosnt display and an email does not send.
<?php
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
@$upload1_Name = $_FILES['upload1']['name'];
@$upload1_Size = $_FILES['upload1']['size'];
@$upload1_Temp = $_FILES['upload1']['tmp_name'];
@$upload2_Name = $_FILES['upload2']['name'];
@$upload2_Size = $_FILES['upload2']['size'];
@$upload2_Temp = $_FILES['upload2']['tmp_name'];
@$upload(n)_Name = $_FILES['upload(n)']['name'];
@$upload(n)_Size = $_FILES['upload(n)']['size'];
@$upload(n)_Temp = $_FILES['upload(n)']['tmp_name'];
if ($upload_Size>0)
{
if( $upload_Size >2000000)
{
//delete file
unlink($upload_Temp);
header("Location: error.html");
exit;
}
}
if ($upload1_Size>0)
{
if( $upload1_Size >2000000)
{
//delete file
unlink($upload1_Temp);
header("Location: error.html");
exit;
}
}
if ($upload2_Size>0)
{
if( $upload2_Size >2000000)
{
//delete file
unlink($upload2_Temp);
header("Location: error.html");
exit;
}
}
if ($upload(n)_Size>0)
{
if( $upload(n)_Size >2000000)
{
//delete file
unlink($upload(n)_Temp);
header("Location: error.html");
exit;
}
}
if ($upload_Size>0)
{
$uploadFile = "uploads/".$upload_Name ;
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = "<A href="http://www.witguides.com/uploads/".$upload_Name">http://www.witguides.com/uploads/".$upload_Name ;
if ($upload1_Size>0)
{
$uploadFile = "uploads/".$upload1_Name ;
@move_uploaded_file( $upload1_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload1_URL = "<A href="http://www.witguides.com/uploads/".$upload1_Name">http://www.witguides.com/uploads/".$upload1_Name ;
}
if ($upload2_Size>0)
{
$uploadFile = "uploads/".$upload2_Name ;
@move_uploaded_file( $upload2_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload2_URL = "<A href="http://www.witguides.com/uploads/".$upload2_Name">http://www.witguides.com/uploads/".$upload2_Name ;
}
if ($upload(n)_Size>0)
{
$uploadFile = "uploads/".$upload(n)_Name ;
@move_uploaded_file( $upload(n)_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload(n)_URL = "<A href="http://www.witguides.com/uploads/".$upload(n)_Name">http://www.witguides.com/uploads/".$upload(n)_Name ;
}
//Sending Email to form owner
$mailto = "wkillvi@witguides.com";
$mailsubj = "Boat Advertisment";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
$mailbody .= "File Link 1: $upload_URL\n";
$mailbody .= "File Link 2: $upload1_URL\n";
$mailbody .= "File Link 3: $upload2_URL\n";
$mailbody .= "File Link 4: $upload(n)_URL\n";
$mailbody .= "If any link is broken, please copy and paste it in your browser's address bar\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou_page.html");
?>
Parse error: syntax error, unexpected T_STRING in /home2/wkillvi/public_html/uploadaction.php on line 13
I have four upload files and the last one is named (n) at first it was 3 but this didnt work either. The thanh_you page dosnt display and an email does not send.
<?php
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
@$upload1_Name = $_FILES['upload1']['name'];
@$upload1_Size = $_FILES['upload1']['size'];
@$upload1_Temp = $_FILES['upload1']['tmp_name'];
@$upload2_Name = $_FILES['upload2']['name'];
@$upload2_Size = $_FILES['upload2']['size'];
@$upload2_Temp = $_FILES['upload2']['tmp_name'];
@$upload(n)_Name = $_FILES['upload(n)']['name'];
@$upload(n)_Size = $_FILES['upload(n)']['size'];
@$upload(n)_Temp = $_FILES['upload(n)']['tmp_name'];
if ($upload_Size>0)
{
if( $upload_Size >2000000)
{
//delete file
unlink($upload_Temp);
header("Location: error.html");
exit;
}
}
if ($upload1_Size>0)
{
if( $upload1_Size >2000000)
{
//delete file
unlink($upload1_Temp);
header("Location: error.html");
exit;
}
}
if ($upload2_Size>0)
{
if( $upload2_Size >2000000)
{
//delete file
unlink($upload2_Temp);
header("Location: error.html");
exit;
}
}
if ($upload(n)_Size>0)
{
if( $upload(n)_Size >2000000)
{
//delete file
unlink($upload(n)_Temp);
header("Location: error.html");
exit;
}
}
if ($upload_Size>0)
{
$uploadFile = "uploads/".$upload_Name ;
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = "<A href="http://www.witguides.com/uploads/".$upload_Name">http://www.witguides.com/uploads/".$upload_Name ;
if ($upload1_Size>0)
{
$uploadFile = "uploads/".$upload1_Name ;
@move_uploaded_file( $upload1_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload1_URL = "<A href="http://www.witguides.com/uploads/".$upload1_Name">http://www.witguides.com/uploads/".$upload1_Name ;
}
if ($upload2_Size>0)
{
$uploadFile = "uploads/".$upload2_Name ;
@move_uploaded_file( $upload2_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload2_URL = "<A href="http://www.witguides.com/uploads/".$upload2_Name">http://www.witguides.com/uploads/".$upload2_Name ;
}
if ($upload(n)_Size>0)
{
$uploadFile = "uploads/".$upload(n)_Name ;
@move_uploaded_file( $upload(n)_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload(n)_URL = "<A href="http://www.witguides.com/uploads/".$upload(n)_Name">http://www.witguides.com/uploads/".$upload(n)_Name ;
}
//Sending Email to form owner
$mailto = "wkillvi@witguides.com";
$mailsubj = "Boat Advertisment";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
$mailbody .= "File Link 1: $upload_URL\n";
$mailbody .= "File Link 2: $upload1_URL\n";
$mailbody .= "File Link 3: $upload2_URL\n";
$mailbody .= "File Link 4: $upload(n)_URL\n";
$mailbody .= "If any link is broken, please copy and paste it in your browser's address bar\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou_page.html");
?>
Comment