Pablo wrote: Sat May 02, 2020 6:28 am
I do not see any errors in the configuration.
What is the generated PHP code?
Of the actual page?
<?php
if (session_id() == "")
{
session_start();
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['formid'] == 'flexgrid1')
{
if (isset($_POST['captcha_code'],$_SESSION['random_txt']) && md5($_POST['captcha_code']) == $_SESSION['random_txt'])
{
unset($_POST['captcha_code'],$_SESSION['random_txt']);
}
else
{
$errorcode = file_get_contents('./form-fail.html');
$replace = "##error##";
$errorcode = str_replace($replace, 'The entered code was wrong.', $errorcode);
echo $errorcode;
exit;
}
}
?>
<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'flexgrid1')
{
$mailto = '
form@warped-tactical.co.uk';
$mailfrom = '
form@warped-tactical.co.uk';
ini_set('sendmail_from', $mailfrom);
$mailname = 'Nobody';
$subject = 'Warped Tac Form';
$message = 'Values submitted from web site form:';
$success_url = './Form-Ok.html';
$error_url = './form-fail.html';
$eol = "\n";
$error = '';
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailname.' <'.$mailfrom.'>'.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;
try
{
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address (" . $mailfrom . ") is invalid!\n<br>";
throw new Exception($error);
}
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail("{$mailto} <{$mailto}>", $subject, $body, $header, '-f'.$mailfrom);
}
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Warped Tactical command!</title>
<meta name="description" content="Contact Warped Tactical command for all your enquiries!">
<meta name="keywords" content="Tactical, Paintball, Team, Scenario, West Midlands, Shropshire, Cosford, Warped, Squad, Wolverhampton, Telford, Shifnal, Shrewsbury, Birmingham, paint, ball, ">
<meta name="author" content="Andy Johnson">
<meta name="generator" content="WYSIWYG Web Builder 15 -
http://www.wysiwygwebbuilder.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="32X32.png" rel="icon" sizes="32x32" type="image/png">
<link href="64X64.png" rel="icon" sizes="64x64" type="image/png">
<link href="wb.validation.css" rel="stylesheet">
<link href="WARPED_TAC.css" rel="stylesheet">
<link href="Contact-Us.css" rel="stylesheet">
<script src="jquery-1.12.4.min.js"></script>
<script src="wb.overlay.min.js"></script>
<script src="wb.validation.min.js"></script>
<script>
function submitwarped_tac_form()
{
var regexp;
var Editbox2 = document.getElementById('Editbox2');
if (!(Editbox2.disabled || Editbox2.style.display === 'none' || Editbox2.style.visibility === 'hidden'))
{
regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
if (!regexp.test(Editbox2.value))
{
alert("Please use a valid email address.");
Editbox2.focus();
return false;
}
if (Editbox2.value == "")
{
alert("Please use a valid email address.");
Editbox2.focus();
return false;
}
}
return true;
}
</script>
<script>
$(document).ready(function()
{
$("#FlexGrid1").submit(function(event)
{
var isValid = $.validate.form(this);
return isValid;
});
var $overlaymenu = $('#OverlayMenu1-overlay');
$overlaymenu.overlay({'hideTransition':true});
$('#OverlayMenu1').on('click', function(e)
{
$.overlay.show($overlaymenu);
return false;
});
$("#Checkbox1").change(function()
{
if ($('#Checkbox1').is(':checked'))
{
$('#Button1').prop('disabled', false);
}
if (!$('#Checkbox1').is(':checked'))
{
$('#Button1').prop('disabled', true);
}
});
$("#Checkbox1").trigger('change');
$("#Captcha1").validate(
{
required: true,
type: 'ajax',
param: 'captcha1_ajax.php',
color_text: '#000000',
color_hint: '#00FF00',
color_error: '#FF0000',
color_border: '#808080',
nohint: true,
font_family: 'Arial',
font_size: '13px',
position: 'centerright',
offsetx: 0,
offsety: 0,
bubble_class: 'bubbleleft',
effect: 'fade',
error_text: 'Please try again.'
});
});
</script>