Click to See Complete Forum and Search --> : Help with form handlers
b.squires
12-08-2005, 01:30 AM
Good day all,
I am developing a website for a group in Counter Strike Source. They need a form and I've developed the form with a "post" method but for the life of me I cannot figure out how to get this information e-mailed off to them via the webserver not the client-side e-mail. Any help would be greatly appreciated.
if you'd like to check out the website I've started check it out:
http://www.thaclan.com
Remember I did literally just start this today.
b.squires
12-08-2005, 02:05 AM
I should also state that currently the "action" right now is a "Mailto:" command and I'm quite sure it's not fully supported by all browsers. I would like to set the action to action="email.php" or cgi or of some script that will email it out however I'm having trouble finding a useful site/book to teach me to write these. I have several books but none touch on actually writing these scripts.
b.squires
12-08-2005, 02:33 PM
Ok...Here's where I'm at. I have developed the a send results form handler in php and it sends to my e-mail via the website however now I can't get it to include the actual information in the form.
Here's the code:
<?php
$subject = 'THA New Recruit';
$emailadd = 'websupport@thaclan.com';
$url = 'http://www.thaclan.com';
$req = '1';
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
Any help would be greatly appreciated...... PLEASE! :)
b.squires
12-08-2005, 04:58 PM
ok got it to work I"m an idiot I left my enctype there derr
Now I moce onto a different problem ;)