1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Contact Form for Blogger

Discussion in 'Blogging' started by andriax, Jan 19, 2010.

  1. andriax

    andriax Newbie

    Nov 6, 2008
    Likes Received:
    This may help if you have blogger blogs ... GET YOUR OWN Contact Form

    This is where is started for me ... http://w**.email-forms.c0m/ you can't do contact forms on your blogs on wordpress.com, you'll need to upgrade.

    This email form allows 20 uses of the contact form per month, any more and there is a fee. Boo Hiss!

    I read the HTML code supplied ... and I'm not a script gal, so I thought hold on a moment. If I replaced the code for the email forms website with a piece of php code I have for one of my own websites, would it work. YES it did...

    Better still I got the contact form in the side column!

    So what I've done is given two scripts below. One is the html and one is the php.

    The php is simply some instructions in a notepad text file saved as a.php file

    Here is the html for the contact form ... you'll have to play around with it a bit to suit your own requirements:

    Go to blogger>layout>add widget>addjavahtml

    You can drop this into your widget to view it or into front page or whatever


    the ** = your website home page - no obliques
    the## = where you've put the renamed notepad file as a php file


    <!-- Begin **Website.com** Form HTML -->
    <form name="contactForm" method="post" action="##Put here the website and location of the php file##.php">
    <p align="center" style="margin-top: 0; margin-bottom: 0; margin-left:10">
    <i><b><font face="Verdana" size="5" color="#FF0000">Start Your
    Compensation Claim Online NOW...</font></b></i></p>
    <p align="center" style="margin-top: 0; margin-bottom: 0">
    <h3 align="center"><font face="Arial Narrow">Contact Information</font></h3>
    <p align="center"><em><font face="Arial Narrow">Which Personal Injury does
    it concern?</font></em></p>
    <p align="center">
    <b><font face="Verdana" size="1">
    <select name="Type of Personal Injury" size="1">
    <option>personal injury</option>
    <option selected>slip trip fall compensation</option>
    <option>car accident</option>
    <option>slip trip and fall</option>
    <option>road traffic whiplash</option>
    <option>motorbike accident</option>
    <option>neck injury claim</option>
    <option>industrial disease</option>
    <option>accident at work</option>
    <option>criminal injury</option>
    <option>medical negligence</option>
    <option>industrial accident</option>
    <p align="center"><em><font face="Arial Narrow">Name</font></em></p>
    <p align="center"><input type="TEXT" name="Name" value size="35"></p>
    <p align="center"><em><font face="Arial Narrow">Telephone Number</font></em></p>
    <p align="center"><input type="TEXT" name="Telephone Number" value size="35"></p>
    <p align="center"><font face="Arial Narrow"><em>E-mail</em></font></p>
    <p align="center"><input type="TEXT" name="Email" value size="35"></p>
    <p align="center"><input type="submit" value="Submit"> <input
    type="RESET" value="Reset Form"> </p>
    <p align="center"><font face="Verdana" size="2">All Email Addresses and
    Telephone Numbers are kept private and confidential and not used for any
    other purpose</font></p>
    <p align="center"><font face="Verdana" size="2">We will contact you within
    24 working hours. Although ... Depending on the time of day it maybe, we may
    contact you within 10 minutes.</font></p>
    <p align="center"><i><b><font face="Verdana" size="2">Best Regards, The
    Injury Lawyers Team</font></b></i></p>
    <!-- End **Website.com** Form HTML -->


    here is the php file - altering these two parts

    ##PUT Relevant Web Address HERE##

    // Receiving variables
    @$pfw_ip= $_SERVER['REMOTE_ADDR'];
    @$Type_of_Personal_Injury = addslashes($_POST['Type_of_Personal_Injury']);
    @$Name = addslashes($_POST['Name']);
    @$Telephone_Number = addslashes($_POST['Telephone_Number']);
    @$Email = addslashes($_POST['Email']);

    // Validation
    if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
    die("<p align='center'><font face='Arial' size='5' color='#000000'>Ooooops... We have a problem.<br><br>We have a security system in place. We require a valid email address.<br><br>Sorry for the inconvenience; but could you press the back button to correct.<br><br>Many Thanks...</font></p>");

    //Sending Email to form owner
    $pfw_header = "From: $Email\n"
    . "Reply-To: $Email\n";
    $pfw_subject = "Re: Personal Injury Claim";
    $pfw_email_to = "****PUT YOUR EMAIL ADDRESS HERE****";
    $pfw_message = "Visitor's IP: $pfw_ip\n"
    . "Type_of_Personal_Injury: $Type_of_Personal_Injury\n"
    . "Name: $Name\n"
    . "Telephone_Number: $Telephone_Number\n"
    . "Email: $Email\n";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

    //Sending auto respond Email to visitor
    $pfw_header = "From: [email protected]##PUT Relevant Web Address HERE##.com\n"
    . "Reply-To: [email protected]##PUT Relevant Web Address HERE##.com\n";
    $pfw_subject = "Personal Injury Enquiry - Confirmation";
    $pfw_email_to = "$Email";
    $pfw_message = "Hi $Name,\n"
    . "\n"
    . "Thank you for your enquiry. As you read this, the process of matching your enquiry to the relevant legal executive is underway.\n"
    . "\n"
    . "We generally respond within a few hours, but enquiries made outside business hours are acted upon next working day.\n"
    . "\n"
    . "We are pleased to be helping you. There is no obligation of course, but we do hope we can exceed your expectations.\n"
    . "\n"
    . "Regards,\n"
    . "\n"
    . "Andy\n"
    . "Personal Injury Claim Adviser";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

    echo("<p align='center'><font face='Arial' size='5' color='#000000'>Thank You... Your Personal Injury Enquiry has been processed correctly. An email confirmation will follow shorlty.<br><br>We generally respond within a few hours, but enquiries made outside business hours are acted upon next working day.<br><br>Many thanks for your interest...</font></p>");


    For the more adventurous the task may be worth doing. The .php file will sit on most servers and work (it needs to go on one of your other 'paid for' websites - ftp it etc...), whether the rest of your website is php or not.

    This thread could be a complete nuisance or a big help. Having a contact form on a free blog looks professional ... and since I've got mine to work I wondered if anybody could use it?