1
General discussion / Re: So, ready for WW3?
« on: September 01, 2013, 12:22:29 am »
British, don't care.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
<?php
session_start();
function generateKybit ($length = 40){
$bitkey = "";
$possible = '123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"£$%^&*()';
$maxlength = strlen($possible);
if ($length > $maxlength) {
$length = $maxlength;
}
$i = 0;
while ($i < $length) {
$char = substr($possible, mt_rand(0, $maxlength-1), 1);
if (!strstr($bitkey, $char)) {
$bitkey .=$char;
$i++;
}
}
return md5($bitkey);
}
$_SESSION['kybit'] = generateKybit();
?>
<?php
session_start();
$sendto = "info@you.com";
$details = array(htmlentities($_POST['name']),$_POST['email'],htmlentities($_POST['phone']));
$message = "A person has tried to contact you via your website.\nName: " . $details[0] . "\nNumber: " . $details[2] . "\nEmail: " . $details[1];
if (isset($_SESSION['kybit'])){
} else {
$_SESSION['kybit'] = rand(5, 40);
}
$kybit['client'] = $_SESSION['kybit'];
$kybit['server'] = $_GET['ky'];
if ($kybit['client'] == $kybit['server']){
if(!filter_var($details[1], FILTER_VALIDATE_EMAIL))
{
exit("<div style='font-family:Arial;background-color:#FF7A7A;border:solid 5px #C90000;padding:20px;width:170px;margin:0 auto;'><p><strong>E-mail is not valid.<br/> <a href='index.php'> « Go Back</a></strong></p>");
}
mail($sendto,'Website Enqiry', $message);
$_SESSION['kybit'] = rand(5, 40);
echo "<div style='font-family:Arial;background-color:#A6FFA7;border:solid 5px #007A02;padding:20px;width:170px;margin:0 auto;'><p><strong>Email Sent!</strong><br/> <a href='index.php'> « Go Back</a></strong></p>";
} else {
echo "<div style='font-family:Arial;background-color:#FF7A7A;border:solid 5px #C90000;padding:20px;width:170px;margin:0 auto;'><p><strong>Invalid Security Token</strong></p>";
}
?>