Location: PHPKode > scripts > Link Request Contact Form > link-request-contact-form/output.php
<?php
# ----------------------------------------------------
# ----- LINK REQUEST CONTACT FORM
# ----- Version 3.4
# ----- Created on: 05/04/07
# ----- Designed by: American Financing
# ----- http://www.americanfinancing.net
# ----- For more scripts, please visit us at http://www.americanfinancing.net/free-scripts.cfm
# ----- Please feel free to modify this script for your own purpose.
# ----- ENJOY!!!
# ----------------------------------------------------


// Receiving variables
@$Full_Name = addslashes($_POST['Full_Name']);
@$email = addslashes($_POST['email']);
@$Link_Back = addslashes($_POST['Link_Back']);
@$Site_Title = addslashes($_POST['Site_Title']);
@$You_Web_Address = addslashes($_POST['You_Web_Address']);
@$Site_Description = addslashes($_POST['Site_Description']);
@$upload_Name = $_FILES['upload']['name'];
@$upload_Size = $_FILES['upload']['size'];
@$upload_Temp = $_FILES['upload']['tmp_name'];
@$upload_Mime_Type = $_FILES['upload']['type'];

function RecursiveMkdir($path)
 {
   if (!file_exists($path)) 
   { 
      RecursiveMkdir(dirname($path));
      mkdir($path, 0777);
    }
  }


// Validation
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
header("Location: error.html");
exit;
}

if( $upload_Size == 0)
{
header("Location: error.html");
exit;
}
if( $upload_Size >1900000)
{
//delete file 
unlink($upload_Temp);
header("Location: error.html");
exit;
}
if( $upload_Mime_Type != "image/cgm" AND $upload_Mime_Type != "image/g3fax" AND $upload_Mime_Type != "image/gif" AND $upload_Mime_Type != "image/ief" AND $upload_Mime_Type != "image/pjpeg" AND $upload_Mime_Type != "image/jpeg" AND $upload_Mime_Type != "image/naplps" AND $upload_Mime_Type != "image/png" AND $upload_Mime_Type != "image/prs.btif" AND $upload_Mime_Type != "image/prs.pti" AND $upload_Mime_Type != "image/tiff" AND $upload_Mime_Type != "image/vnd.cns.inf2" AND $upload_Mime_Type != "image/vnd.dwg" AND $upload_Mime_Type != "image/vnd.dxf" AND $upload_Mime_Type != "image/vnd.fastbidsheet" AND $upload_Mime_Type != "image/vnd.fpx" AND $upload_Mime_Type != "image/vnd.fst" AND $upload_Mime_Type != "image/vnd.fujixerox.edmics-mmr" AND $upload_Mime_Type != "image/vnd.fujixerox.edmics-rlc" AND $upload_Mime_Type != "image/vnd.mix" AND $upload_Mime_Type != "image/vnd.net-fpx" AND $upload_Mime_Type != "image/vnd.svf" AND $upload_Mime_Type != "image/vnd.wap.wbmp" AND $upload_Mime_Type != "image/vnd.xiff" )
{
unlink($upload_Temp);
header("Location: error.html");
exit;
}
$uploadFile = "uploads/".$upload_Name ;
if (!is_dir(dirname($uploadFile)))
  {
    @RecursiveMkdir(dirname($uploadFile)); 
  }
else
  {
  @chmod(dirname($uploadFile), 0777);
  }
@move_uploaded_file( $upload_Temp , $uploadFile); 
chmod($uploadFile, 0644);
// Changes This to Your URL
$upload_URL = "http://your-url.com/uploads/".$upload_Name ;
//........................................................................

//Sending Email to form owner
# Email to Owner 
$pfw_header = "From: $email";
$pfw_subject = "My Link Request Contact Form";
// Change this to your email address
$pfw_email_to = "hide@address.com";
//........................................................................
$pfw_message = "Full_Name: $Full_Name\n"
. "email: $email\n"
. "Link_Back: $Link_Back\n"
. "Site_Title: $Site_Title\n"
. "You_Web_Address: $You_Web_Address\n"
. "Site_Description: $Site_Description\n"
. "upload: $upload_URL\n"
. "\n"
. "Script Provided By: American Financing\n"
. "http://www.americanfinancing.net";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

//Sending auto respond Email to user
# Email to Owner 
// Change this to your email address
$pfw_header = "From: hide@address.com";
//........................................................................
$pfw_subject = "Confirmation Auto Responder";
$pfw_email_to = "$email";
$pfw_message = "Full_Name: $Full_Name\n"
. "email: $email\n"
. "Link_Back: $Link_Back\n"
. "Site_Title: $Site_Title\n"
. "You_Web_Address: $You_Web_Address\n"
. "Site_Description: $Site_Description\n"
. "upload: $upload_URL\n"
. "\n"
. "Script Provided By: American Financing\n"
. "http://www.americanfinancing.net";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

header("Location: thank_you.html");

?>
Return current item: Link Request Contact Form