11-06-2011, 07:19 AM
11-06-2011, 06:39 PM
You're welcome Zombot, hope it serves you well.
11-07-2011, 06:36 PM
Alright this looks good im trying it right now!!!
11-08-2011, 06:23 AM
Cool. But don't really need it.
Very HQ OP.
Very HQ OP.
11-29-2011, 01:50 PM
Not meaning to bump, but this is more complicated then necessary.
Code:
<?php
if($_POST['act']=='Send')
{
$to = $_POST['to'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$from = $_POST['from'];
$lenght = strlen($_POST['message']);
if(!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $to))
{
$req['to']='<b>The email is invalid</b>';
}
if(!$subject)
{
$req['s']='<b>Required</b>';
}
if(!$message)
{
$req['m']='<b>Required</b>';
}
if(!$from)
{
$req['f']='<b>Required</b>';
}
if(strlen(trim($subject))<4)
{
$req['s']='<b>The field is too short</b>';
}
if(strlen(trim($message))>600)
{
$req['m']='<b>The field is too long</b>';
}
if(!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $to))
{
$req['f']='<b>The email is invalid</b>';
}
elseif(!$req)
{
$headers = 'From: ' . $from;
mail($to, $subject, $message, $headers);
echo 'The message sending was successful!';
}
/*if ($lenght <= 2) {
$headers = 'From: ' . $from;
mail($to, $subject, $message, $headers);
echo 'The message sending was successful!'; } */
}
echo '
<table><form method="POST">
<tr><td><h3>To:</h3></td><td><input type="text" name="to" value="'.$to.'"> ';
if($req['to'])
{
echo $req['to'];
}
echo '</td></tr>
<tr><td><h3>Message:</h3><td><textarea rows="5" cols="40" name="message">'.$message.'</textarea> ';
if($req['m'])
{
echo $req['m'];
}
echo '</td></tr>
<tr><td><h3>Subject:</h3><td><input type="text" name="subject" value="'.$subject.'"> ';
if($req['s'])
{
echo $req['s'];
}
echo '</td></tr>
<tr><td><h3>From:</h3><td><input type="text" name="from" value="'.$from.'"> ';
if($req['f'])
{
echo $req['f'];
}
echo '</td></tr>
<tr><td><input type="submit" name="act" value="Send"></td>
</form></table>';
echo '</body></html>';
?>
<h1>WiredPrograms.webege.com 2011</h1>
11-30-2011, 10:31 AM
Live demonstration sites are down Breshie.
11-30-2011, 01:51 PM
I know, I removed them all after getting bandwidth drained. I'll get my friend to add it to his site soon!
12-14-2011, 03:42 AM
Thanks for share mate. Gonna test it right now.