Re: Advance blue voda form processor
Use the following:
<?php
// Set file size limit
$size_limit = 1000000; // Set it to whatever size you want in Bytes
// Receiving variables
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
$upload_Name_Name = str_replace(" ", "_", $upload_Name);
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
@$upload2_Name = $_FILES['upload2']['name'];
$upload2_Name_Name = str_replace(" ", "_", $upload2_Name);
@$upload2_Size = $_FILES['upload2']['size'];
@$upload2_Temp = $_FILES['upload2']['tmp_name'];
@$upload3_Name = $_FILES['upload3']['name'];
$upload3_Name_Name = str_replace(" ", "_", $upload3_Name);
@$upload3_Size = $_FILES['upload3']['size'];
@$upload3_Temp = $_FILES['upload3']['tmp_name'];
// Validation for existing file and max file size
if ($upload_Size>0 and $upload_Size <= $size_limit)
{
$uploadFile = "uploads/".$upload_Name ;
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = "http://www.ideaspersonales.com/uploads/".$upload_Name ;
}
if ($upload2_Size>0 and $upload2_Size <= $size_limit)
{
$uploadFile = "uploads/".$upload2_Name ;
@move_uploaded_file( $upload2_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload2_URL = "http://www.ideaspersonales.com/uploads/".$upload2_Name ;
}
if ($upload3_Size>0 and $upload3_Size <= $size_limit)
{
$uploadFile = "uploads/".$upload3_Name ;
@move_uploaded_file( $upload3_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload3_URL = "http://www.ideaspersonales.com/uploads/".$upload3_Name ;
}
//Sending Email to form owner
$mailto = "info@ideaspersonales.com";
$mailsubj = "COTIZACION";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Datos del cliente y link de archivos :\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: $upload2_URL\n";
$mailbody .= "File Link 3: $upload3_URL\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou_page.html");
?>
I have changed the code so if a file name contains whitespaces (blanks) the script will replace them with an underscore, so links should not result broken anymore.
To change the order of the data in your email (as well as the TAB order of your form fields) follow this simple procedure:
Right click on the field you want first, and select "Move to front".
repeat for all fields, in the order you want them to appear. include your submit and reset buttons.
Why don't you simply use ABVFP ?
It will do what you want, without need for coding.
Use the following:
<?php
// Set file size limit
$size_limit = 1000000; // Set it to whatever size you want in Bytes
// Receiving variables
@$email = addslashes($_POST['email']);
@$upload_Name = $_FILES['upload']['name'];
$upload_Name_Name = str_replace(" ", "_", $upload_Name);
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
@$upload2_Name = $_FILES['upload2']['name'];
$upload2_Name_Name = str_replace(" ", "_", $upload2_Name);
@$upload2_Size = $_FILES['upload2']['size'];
@$upload2_Temp = $_FILES['upload2']['tmp_name'];
@$upload3_Name = $_FILES['upload3']['name'];
$upload3_Name_Name = str_replace(" ", "_", $upload3_Name);
@$upload3_Size = $_FILES['upload3']['size'];
@$upload3_Temp = $_FILES['upload3']['tmp_name'];
// Validation for existing file and max file size
if ($upload_Size>0 and $upload_Size <= $size_limit)
{
$uploadFile = "uploads/".$upload_Name ;
@move_uploaded_file( $upload_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload_URL = "http://www.ideaspersonales.com/uploads/".$upload_Name ;
}
if ($upload2_Size>0 and $upload2_Size <= $size_limit)
{
$uploadFile = "uploads/".$upload2_Name ;
@move_uploaded_file( $upload2_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload2_URL = "http://www.ideaspersonales.com/uploads/".$upload2_Name ;
}
if ($upload3_Size>0 and $upload3_Size <= $size_limit)
{
$uploadFile = "uploads/".$upload3_Name ;
@move_uploaded_file( $upload3_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upload3_URL = "http://www.ideaspersonales.com/uploads/".$upload3_Name ;
}
//Sending Email to form owner
$mailto = "info@ideaspersonales.com";
$mailsubj = "COTIZACION";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Datos del cliente y link de archivos :\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: $upload2_URL\n";
$mailbody .= "File Link 3: $upload3_URL\n";
mail($mailto, $mailsubj, $mailbody, $mailhead);
header("Location: thankyou_page.html");
?>
I have changed the code so if a file name contains whitespaces (blanks) the script will replace them with an underscore, so links should not result broken anymore.
To change the order of the data in your email (as well as the TAB order of your form fields) follow this simple procedure:
Right click on the field you want first, and select "Move to front".
repeat for all fields, in the order you want them to appear. include your submit and reset buttons.
Why don't you simply use ABVFP ?
It will do what you want, without need for coding.
Comment