How can i prevent for my php action file to dont be loadit in the browser?
Here is the code to you guys have a idea
Code: Select all
<?php
$datahora = "DATA: <B>" . date("d/m/y - H:i:s") . "</B><BR><BR>";
foreach ($_POST as $campo => $valor) {
if (($campo == 'imageField2_x') or ($campo == 'imageField2') or ($campo == 'imageField2_y') or ($campo == 'distrito') or ($campo == 'subimit_y') or ($campo == 'codigo') or ($campo == 'seguranca')) {}else {
if ($valor <> '') {
$campo = str_replace("_", " ",$campo);
$campos .= strtoupper($campo) . ": <b>" . $valor . "</b><Br>";
}
}
}
$www = "WWW.USA.COM";
$assunto = "CONTACT - USA - " . $www;
$conteudo = "CONTACT - USA<br><br>" . $datahora . ($campos) . "<br>" . $www;
$para = "madness@hotmail.com";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: USA <info@usa.com>\r\n";
$headers .= "Reply-To: ".$_POST['email']."\r\n";
if ($_POST['codigo'] == $_POST['seguranca']) {
if (mail($para,$assunto,$conteudo,$headers) == true){ ?>
<script>
alert('Sent sucess!');
window.location = 'contact.php';
</script>
<? }} ?>