Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
    <?php
    define("CONTACT_FORM", 'senseless.v.7@gmail.com');
    function ValidateEmail($value){
        $regex = '/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i';
        if($value == '') { 
            return false;
        } else {
            $string = preg_replace($regex, '', $value);
        }
        return empty($string) ? true : false;
    }
    $post = (!empty($_POST)) ? true : false;
    if($post){
        // $name = stripslashes($_POST['name']);
        // $phone = stripslashes($_POST['phone']);
        // $email = stripslashes($_POST['email']);
        // $pass = stripslashes($_POST['pass']);
        $total = stripslashes($_POST['total']);
        $subject = 'Заявка';
        $error = '';    
        $message = '
            <html>
                    <head>
                            <title>Заявка</title>
                    </head>
                    <body>
                            
                            <p>Total : '.$total.'</p>
                    </body>
            </html>';
        // if (!ValidateEmail($email)){
        //  $error = 'Email введен неправильно!';
        // }
        if(!$error){
            $mail = mail(CONTACT_FORM, $subject, $message,
                 "From: ".$name." <".$email.">\r\n"
                ."Reply-To: ".$email."\r\n"
                ."Content-type: text/html; charset=utf-8 \r\n"
                ."X-Mailer: PHP/" . phpversion());
            if($mail){
                echo "OK";
            }
        }else{
            echo '<div class="bg-danger">'.$error.'</div>';
        }
    }
?>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
lime7pro
0viewers