1
Beginners - Learning PHP /
« on: August 30, 2007, 10:03:43 PM »
Danke 
Seid bereit immer bereit
Seid bereit immer bereit
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
require_once("configapply.php");
error_reporting(E_ALL );
function Get_Text()
{
global $text_length;
$letters = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G",
"h","H","i","I","j","J","k",
"K","l","L","m","M","n","N","o","O","p","P","q","Q","r",
"R","s","S","t","T","u","U","v",
"V","w","W","x","X","y","Y","z","Z","1","2","3","4","5",
"6","7","8","9");
mt_srand((double)microtime()*1000000);
$txt = "";
//$rand_keys = array_rand($letters, $text_length);
//foreach($rand_keys as $key)
// {
// $txt .= $letters[$key];
// }
shuffle($letters);
for($i=0;$i<$text_length;$i++)
{
$key = rand(0,count($letters)-1);
$txt .= $letters[$key];
}
return $txt;
}
function create_image()
{
global $width,$hight,$text_length,$border;
$im = imagecreate($width,$hight);
$bgc = imagecolorallocate($im, rand(235,255), rand(235,255),rand(235,255));
$tc = imagecolorallocate($im, 0, 0, 0);
imagefill($im,0,0,$tc);
imagefilledrectangle($im,$border,$border,$width-$border,$hight-$border,$bgc);
return $im;
}
function draw_string($txt,$im)
{
global $hight,$width,$font,$text_length;
$space1 = $width/($text_length+1); //space between characters
$space2 = ($width - $space1)/3 ; //space between lines
$center = $hight/2;
for($f=0;$f<3;$f++)
{
$y1 = $center/2;
$y2 = 1.5*$center;
$x1 = ($space1/2) + ($f * $space2);
$x2 = ($space1/2) + (($f +1) * $space2);
// echo "$x1,$x2 + $y1,$y2 <br>";
for($k=0;$k<2;$k++)
{
$lc = imagecolorallocate($im,rand(0,200), rand(0,200), rand(0,200));
imageline($im,rand($x1,$x2),rand($y1,$y2),rand($x1,$x2),rand($y1,$y2),$lc);
}
}
for($i=0;$i<$text_length;$i++)
{
$txtc = imagecolorallocate($im,rand(0,160), rand(0,160), rand(0,160));
$x = ($space1+($i*$space1)); //x coordinate of each character
imagestring($im,$font,$x,rand($center-($center/2),$center),$txt[$i],$txtc);
}
}
?>
<?php
@$Features = addslashes($_POST['Features']);
require_once("check.php");
if (! ereg('[A-Za-z0-9_-]+@[A-Za-z0-9_-]+.[A-Za-z0-9_-]+', $email))
{
header("Location: error.html");
exit;
}
$pfw_header = "From: $email";
$pfw_subject = "Application Has Arrived";
$pfw_email_to = "email@domain.com";
$pfw_message = "First Name: $NameFirstn"
. "Features: $Featuresn"
. "";
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
$pfw_header = "From: email@domain.com";
$pfw_subject = "Confirmation";
$pfw_email_to = "$email";
$pfw_message = "We have recieved your Application.n"
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: thank-you.html");
?>
Pretty cut and Dry. So now I'll explain what's going on. <table width="100%" height="165" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top">
<tr>
<td><form method="post" action="contact.php">
<table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
<tr>
<td>
<font size="2">
Please Check all that apply:
</font>
<p>
<input type="checkbox" value="Dining Room" name="Features[]" >
<font face="Verdana" size="1">Dining Room</font>
<input type="checkbox" value="Family Room" name="Features[]" >
<font face="Verdana" size="1">Family Room </font>
<input type="checkbox" value="Living Room" name="Features[]" >
<font face="Verdana" size="1">Living Room </font>
<input type="checkbox" value="Bonus Room" name="Features[]" >
<font face="Verdana" size="1">Bonus Room </font>
<p>
<input type="checkbox" value="Fire Place" name="Features[]" >
<font face="Verdana" size="1">Fire Place  </font>
<input type="checkbox" value="Central Air" name="Features[]" >
<font face="Verdana" size="1">Central Air </font>
<input type="checkbox" value="Deck" name="Features[]" >
<font face="Verdana" size="1">Deck </font>
<input type="checkbox" value="Above Ground Pool" name="Features[]" >
<font face="Verdana" size="1">Above Ground Pool</font>
<p>
<input type="checkbox" value="Great Room" name="Features[]" >
<font face="Verdana" size="1">Great Room </font>
<input type="checkbox" value="In Ground Pool" name="Features[]" >
<font face="Verdana" size="1">In Ground Pool</font>
<input type="checkbox" value="Screened Patio" name="Features[]" >
<font face="Verdana" size="1">Screened Patio</font>
<input type="checkbox" value="Screened Pool Enclosure" name="Features[]" >
<font face="Verdana" size="1">Screened Pool Enclosure</font>
<p>
<input type="checkbox" value="Fence" name="Features[]" >
<font face="Verdana" size="1">Fence </font>
<input type="checkbox" value="Central Heat" name="Features[]" >
<font face="Verdana" size="1">Central Heat</font>
</tr>