Forum Replies Created

  • Greg Parrott

    December 14, 2010 at 9:28 am in reply to: php email form

    this is the send sendresults.php which sends what ever is on the form

    <?php
    //————————–Set these paramaters————————–

    // Subject of email sent to you.
    $subject = ‘Order Request’;

    // Your email address. This is where the form information will be sent.
    $emailadd = ‘greg@parrott.co.uk’;

    // Where to redirect after form is processed.
    $url = ‘https://www.absalomandtribe.co.uk/index.html’;

    // Makes all fields required. If set to ‘1’ no field can not be empty. If set to ‘0’ any or all fields can be empty.
    $req = ‘0’;

    // ————————–Do not edit below this line————————–
    $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 >= 500000)
    {echo “Name of form element $key cannot be longer than 500000 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 ”;
    ?>

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy