<?php
ini_set('display_errors', 1);
    $to = "mert@independenteuro.com"; 
    $from = $_REQUEST['name11']; 
    $fullname = $_REQUEST['name11']; 
    $headers = "From: $from"; 
    $subject = "You have a message sent from your site"; 

    $fields = array(); 
    $fields{"name11"} = "Name";     
    $fields{"phone11"} = "Number"; 
    $fields{"email11"} = "Email";
    $fields{"message"} = "Message";

    $body = "Message Body:\n\n"; foreach($fields as $a => $b){   $body .= sprintf("%s: %s\n",$b,$_REQUEST[$a]); }

    $send = mail($to, $subject, $body, $headers);
//$home_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

//$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
//$Get_url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
//echo $currentUrl;


$current  = $_SERVER['REQUEST_URI'];
$previous = $_POST['previous'];

session_start();
$_SESSION["url"]=$_SERVER['REQUEST_URI'];

//$previousUrl = $_SERVER['HTTP_REFERER'];
$previousUrl = "http://webdemoapp.com/lews_brake_shop_live/thankyou";

header('Location: ' . $previousUrl);
?>