File: /home/joderbya/public_html/foiroubado.com/111/backup/securimage/form.html
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start(); // this MUST be called prior to any output including whitespaces and line breaks!
$GLOBALS['DEBUG_MODE'] = 1;
// CHANGE TO 0 TO TURN OFF DEBUG MODE
// IN DEBUG MODE, ONLY THE CAPTCHA CODE IS VALIDATED, AND NO EMAIL IS SENT
$GLOBALS['ct_recipient'] = 'YOU@EXAMPLE.COM'; // Change to your email address! Make sure DEBUG_MODE above is 0 for mail to send!
$GLOBALS['ct_msg_subject'] = 'Securimage Test Contact Form';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Moçambique Lista Negra</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>
<script>
function resetForm()
{
document.getElementById("element_2").disabled = false;
document.getElementById("element_3").disabled = false;
document.getElementById("element_4").disabled = false;
document.getElementById("element_5").disabled = false;
//document.getElementById("element_2").style.color = "none";
document.getElementById("element_2").style.background = "white";
//document.getElementById("element_3").style.color = "none";
document.getElementById("element_3").style.background = "white";
//document.getElementById("element_4").style.color = "none";
document.getElementById("element_4").style.background = "white";
//document.getElementById("element_5").style.color = "none";
document.getElementById("element_5").style.background = "white";
}
function automovel()
{
resetForm();2
document.getElementById("element_2").disabled = true;
document.getElementById("element_2").style.color = "#AAA";
document.getElementById("element_2").style.background = "#F5F5F5";
}
function telemovel()
{
resetForm();
document.getElementById("element_3").disabled = true;
document.getElementById("element_3").style.color = "#AAA";
document.getElementById("element_3").style.background = "#F5F5F5";
document.getElementById("element_4").disabled = true;
document.getElementById("element_4").style.color = "#AAA";
document.getElementById("element_4").style.background = "#F5F5F5";
document.getElementById("element_5").disabled = true;
document.getElementById("element_5").style.color = "#AAA";
document.getElementById("element_5").style.background = "#F5F5F5";
}
function bicicleta()
{
resetForm();
document.getElementById("element_3").disabled = true;
document.getElementById("element_3").style.color = "#AAA";
document.getElementById("element_3").style.background = "#F5F5F5";
document.getElementById("element_5").disabled = true;
document.getElementById("element_5").style.color = "#AAA";
document.getElementById("element_5").style.background = "#F5F5F5";
}
function pesquisar()
{
var XHR = new XMLHttpRequest();
var FD = new FormData();
var t_objecto = document.forms["submit"]["element_7"].value;
var n_serie = document.forms["submit"]["element_2"].value;
var n_motor = document.forms["submit"]["element_3"].value;
var n_quadro = document.forms["submit"]["element_4"].value;
var matricula = document.forms["submit"]["element_5"].value;
// We push our data into our FormData object
//for(name in cliente) {
FD.append('element_7', t_objecto);
FD.append('element_2', n_serie);
FD.append('element_3', n_motor);
FD.append('element_4', n_quadro);
FD.append('element_5', matricula);
XHR.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
if (this.responseText.length == 0)
alert("Registo não encontrado");
else document.getElementById("content").innerHTML = this.responseText;
}
};
// We define what will happen if the data are successfully sent
XHR.addEventListener('load', function(event) {
//alert('Registado com sucesso.');
});
// We define what will happen in case of error
XHR.addEventListener('error', function(event) {
alert('Oups! Erro ao gravar.');
});
// We setup our request
XHR.open('POST', 'http://192.168.167.202/foiroubado.com/securimage/Pesqform.php');
// We just send our FormData object, HTTP headers are set automatically
XHR.send(FD);
}
</script>
</head>
<body id="main_body" >
<img id="top" src="top.png" alt="">
<div id="form_container">
<div id="topBar">
<img id="flag" src="flag.png" width="30" height="20" alt="">
<div id="whatsapp"><a href="http://www.foiroubado.com">
<div id="icon">
<img src="whatsapp.png" width="25" height="25" alt="">
</div>
<div id="lab1">
<a>Reportar!!!</a>
</div>
<div id="lab2">
<a>+258 8x xxx-xxx</a>
</div></a>
</div>
</div>
<div id="content">
<?php
process_si_contact_form(); // Process the form, if it was submitted
if (isset($_SESSION['ctform']['error']) && $_SESSION['ctform']['error'] == true): /* The last form submission had 1 or more errors */ ?>
<div class="error">There was a problem with your submission. Errors are displayed below in red.</div><br>
<?php elseif (isset($_SESSION['ctform']['success']) && $_SESSION['ctform']['success'] == true): /* form was processed successfully */ ?>
<div class="success">The captcha was correct and the message has been sent! The captcha was solved in <?php echo $_SESSION['ctform']['timetosolve'] ?> seconds.</div><br />
<?php endif; ?>
<form id="form_47822" name="submit" class="appnitro" method="post" action="Pesqform.php">
<div class="form_description">
<h2>Moçambique Lista Negra</h2>
<p>Roubados em Moçambique</p>
</div>
<ul >
<li class="section_break">
<h3>Selecione o Tipo de Objecto </h3>
<p></p>
</li> <li id="li_7" >
<label class="description" for="element_7">Tipo </label>
<div>
<select class="element select medium" id="element_7" name="element_7">
<option value="automovel" selected="selected" onclick="automovel()">Automóvel</option>
<option value="bicicleta" onclick="bicicleta()">Bicicleta</option>
<option value="motorizada" onclick="automovel()">Motorizada</option>
<option value="telemovel" onclick="telemovel()">Telemóvel</option>
<option value="barco" onclick="automovel()">Barco</option>
</select>
</div>
</li> <li class="section_break">
<h3>Indicar Apenas um dos Seguintes Números</h3>
<p></p>
</li> <li id="li_2" >
<label class="description" for="element_2">Número de Série </label>
<div>
<input id="element_2" name="element_2" class="element text medium" type="text" maxlength="255" value=""/>
</div>
</li> <li id="li_3" >
<label class="description" for="element_3">Número do Motor </label>
<div>
<input id="element_3" name="element_3" class="element text medium" type="text" maxlength="255" value=""/>
</div>
</li> <li id="li_4" >
<label class="description" for="element_4">Número do Quadro </label>
<div>
<input id="element_4" name="element_4" class="element text medium" type="text" maxlength="255" value=""/>
</div>
</li> <li id="li_5" >
<label class="description" for="element_5">Matrícula </label>
<div>
<input id="element_5" name="element_5" class="element text medium" type="text" maxlength="255" value=""/>
</div>
</li>
<?php
// show captcha HTML using Securimage::getCaptchaHtml()
require_once 'securimage.php';
$options = array();
$options['input_name'] = 'ct_captcha'; // change name of input element for form post
$options['disable_flash_fallback'] = false; // allow flash fallback
if (!empty($_SESSION['ctform']['captcha_error'])) {
// error html to show in captcha output
$options['error_html'] = $_SESSION['ctform']['captcha_error'];
}
echo "<div id='captcha_container_1'>\n";
echo Securimage::getCaptchaHtml($options);
echo "\n</div>\n";
/*
// To render some or all captcha components individually
$options['input_name'] = 'ct_captcha_2';
$options['image_id'] = 'ct_captcha_2';
$options['input_id'] = 'ct_captcha_2';
$options['namespace'] = 'captcha2';
echo "<br>\n<div id='captcha_container_2'>\n";
echo Securimage::getCaptchaHtml($options, Securimage::HTML_IMG);
echo Securimage::getCaptchaHtml($options, Securimage::HTML_ICON_REFRESH);
echo Securimage::getCaptchaHtml($options, Securimage::HTML_AUDIO);
echo '<div style="clear: both"></div>';
echo Securimage::getCaptchaHtml($options, Securimage::HTML_INPUT_LABEL);
echo Securimage::getCaptchaHtml($options, Securimage::HTML_INPUT);
echo "\n</div>";
*/
?>
<li class="buttons">
<input type="hidden" name="form_id" value="47822" />
<!-- <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" /> -->
<button id="saveForm" class="button_text" type="button" name="submit" onClick="pesquisar()">Submeter</button>
</li>
</ul>
</form>
</div>
<div id="footer">
Powered by <a href="http://www.foiroubado.com">foi roubado</a>
</div>
</div>
<img id="bottom" src="bottom.png" alt="">
</body>
</html>
<?php
// The form processor PHP code
function process_si_contact_form()
{
$_SESSION['ctform'] = array(); // re-initialize the form session data
if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['do'] == 'contact') {
// if the form has been submitted
foreach($_POST as $key => $value) {
if (!is_array($key)) {
// sanitize the input data
if ($key != 'ct_message') $value = strip_tags($value);
$_POST[$key] = htmlspecialchars(stripslashes(trim($value)));
}
}
$name = @$_POST['ct_name']; // name from the form
$email = @$_POST['ct_email']; // email from the form
$URL = @$_POST['ct_URL']; // url from the form
$message = @$_POST['ct_message']; // the message from the form
$captcha = @$_POST['ct_captcha']; // the user's entry for the captcha code
$name = substr($name, 0, 64); // limit name to 64 characters
$errors = array(); // initialize empty error array
if (isset($GLOBALS['DEBUG_MODE']) && $GLOBALS['DEBUG_MODE'] == false) {
// only check for errors if the form is not in debug mode
if (strlen($name) < 3) {
// name too short, add error
$errors['name_error'] = 'Your name is required';
}
if (strlen($email) == 0) {
// no email address given
$errors['email_error'] = 'Email address is required';
} else if ( !preg_match('/^(?:[\w\d-]+\.?)+@(?:(?:[\w\d]\-?)+\.)+\w{2,63}$/i', $email)) {
// invalid email format
$errors['email_error'] = 'Email address entered is invalid';
}
if (strlen($message) < 20) {
// message length too short
$errors['message_error'] = 'Your message must be longer than 20 characters';
}
}
// Only try to validate the captcha if the form has no errors
// This is especially important for ajax calls
if (sizeof($errors) == 0) {
require_once dirname(__FILE__) . '/securimage.php';
$securimage = new Securimage();
if ($securimage->check($captcha) == false) {
$errors['captcha_error'] = 'Incorrect security code entered<br />';
}
}
if (sizeof($errors) == 0) {
// no errors, send the form
$time = date('r');
$message = "A message was submitted from the contact form. The following information was provided.<br /><br />"
. "<em>Name: $name</em><br />"
. "<em>Email: $email</em><br />"
. "<em>URL: $URL</em><br />"
. "<em>Message:</em><br />"
. "<pre>$message</pre>"
. "<br /><br /><em>IP Address:</em> {$_SERVER['REMOTE_ADDR']}<br />"
. "<em>Time:</em> $time<br />"
. "<em>Browser:</em> {$_SERVER['HTTP_USER_AGENT']}<br />";
$message = wordwrap($message, 70);
if (isset($GLOBALS['DEBUG_MODE']) && $GLOBALS['DEBUG_MODE'] == false) {
// send the message with mail()
mail($GLOBALS['ct_recipient'], $GLOBALS['ct_msg_subject'], $message, "From: {$GLOBALS['ct_recipient']}\r\nReply-To: {$email}\r\nContent-type: text/html; charset=UTF-8\r\nMIME-Version: 1.0");
}
$_SESSION['ctform']['timetosolve'] = $securimage->getTimeToSolve();
$_SESSION['ctform']['error'] = false; // no error with form
$_SESSION['ctform']['success'] = true; // message sent
} else {
// save the entries, this is to re-populate the form
$_SESSION['ctform']['ct_name'] = $name; // save name from the form submission
$_SESSION['ctform']['ct_email'] = $email; // save email
$_SESSION['ctform']['ct_URL'] = $URL; // save URL
$_SESSION['ctform']['ct_message'] = $message; // save message
foreach($errors as $key => $error) {
// set up error messages to display with each field
$_SESSION['ctform'][$key] = "<span class=\"error\">$error</span>";
}
$_SESSION['ctform']['error'] = true; // set error floag
}
} // POST
}
$_SESSION['ctform']['success'] = false; // clear success value after running