Topic: Blog Contact Form.

Here on my blog: http://blog.adrian-rodriguez.net

I have a contact form at the very bottom, what can I do to the code to make sure that I don't get any spam?

<?php
        $admin_email = get_settings( "contact_email" );
        $admin_subject = get_settings( "contact_subject" );
        $admin_success = get_settings( "contact_success" );
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From: ' . $admin_email . "\r\n";
        $body = "<blockquote>
    Name: " . $_REQUEST['Name'] . "<br/>
    Email: " . $_REQUEST['Email'] . "<br/>
    Message:<br/>" . $_REQUEST['Message'] . "<br/>
    <hr/>
    Remote Address: " . $_SERVER['REMOTE_ADDR'] . "<br/>
    Browser: " . $_SERVER['HTTP_USER_AGENT'] . "
    <hr/>
    </blockquote>";
                mail ($admin_email, $admin_subject, $body, $headers);
?>

Re: Blog Contact Form.

For WP I use: http://www.deliciousdays.com/cforms-plugin

The best wp contact form I've seen with a ton of anti spam stuff already built in.

James Cooper --  God loving, banjo playing, geek!

Re: Blog Contact Form.

That sounds great, but the thing is, this is part of the actual index.php and theme.

Re: Blog Contact Form.

You should be able to edit index.php and put in a call to the cforms form ( <?php insert_cform(); ?> ).  Should be a pretty simple job (with some css editing I expect).  I'm no php expert but can hack wp themes around!

James Cooper --  God loving, banjo playing, geek!

Re: Blog Contact Form.

jpc101 wrote:

You should be able to edit index.php and put in a call to the cforms form ( <?php insert_cform(); ?> ).  Should be a pretty simple job (with some css editing I expect).  I'm no php expert but can hack wp themes around!

Neither am I.

Re: Blog Contact Form.

Adrian:

Hmm...dunno much about the cforms form but perhaps taking a look at this article might help:

http://www.digital-web.com/articles/bul … _with_php/

Also you could probably add a CAPTCHA to the form. Eg.  http://www.captcha.net/

Hope that helps.

Exercise your faith!