We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Website Contact Form

I'd like a contact form on my website; one where people can choses from a drop down list of the products they are most interested in and then fill in a further information box before submitting it. I've done one before, but it sent the form via the users email programed, I'd really like a web based one, I've seen them on loads of sites, but I've no idea how to do it:confused: Can anyone on here help?

Comments

  • M4RKM
    M4RKM Posts: 5,132 Forumite
    1,000 Posts Combo Breaker
    there are various ways of doing this, depends on what your web hosting provider supports

    M
  • 4thfrog
    4thfrog Posts: 56 Forumite
    I'm with relic host, how would find out what they support for this?
  • chunter
    chunter Posts: 2,022 Forumite
    Part of the Furniture 1,000 Posts Combo Breaker
    Nothing in relichosts help.
    But what your looking for is a cgi script form-mailer.
    It's a standard script which you tweak a bit to send the emails to your email address.

    As a member you have access to relic's forums.
    Try a search on their forums or start a thread of your own.

    If cgi isn't an option, try the Fantisco options.
    There should be a form maker in there somewhere.
  • Browntoa
    Browntoa Posts: 49,612 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    bravenet do a free one if memory serves me right ,just embed the html in your contact webpage
    Ex forum ambassador

    Long term forum member
  • Or you can do it via PHP. I can write you a script for free if you want one. It's incredibly simple
  • e00c
    e00c Posts: 228 Forumite
    I'm guessing you know how to make the drop down box your self? and have created the form but don't know how to 'send it'?

    If so.... you need something similar to this .php file (all you do is upload this to your server... and edit your contact form page to use this ..)

    Save this file as "sendmail.php"
    [php]
    <?php

    // Edit these to match your form

    $name = $_POST;
    $email = $_POST;
    $subject = $_POST;
    $company = $_POST;
    $budget = $_POST;

    // Add your e-mail here

    $admin = YOUREMAIL@Mail.COM;

    // Edited these to match your own form

    $message = 'Someone has filled out the contact form on your website' . "\n\n";
    $message .= 'Name: ' . $name . "\n";
    $message .= 'Company: ' . $company . "\n";
    $message .= 'Email: ' . $email . "\n";
    $message .= 'Subject: ' . $subject . "\n";
    $message .= 'Budget: ' . $budget . "\n";
    $message .= "Query:\n\n";
    $message .= $_POST;
    $sendTo = $admin;
    $Bcc = 'YOUREMAIL@MAIL.COM';

    $headers = 'From: Contact Form <' . $email . '>' . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Bcc: ' . $Bcc . "\r\n";

    mail($sendTo, $subject, $message, $headers);

    // replace contact_done with your redirected webpage

    header ("Location: contact_done.html");

    ?>
    [/php]

    Add this at the top of your actual form: <form action="sendmail.php" method="post" name="form1" >

    If you don't understand that - Message me and i'll do it for you..
  • Yep ^^^ that's pretty much what I would have done. I was just in the middle of a HTML crisis so had no time to type it out :D

    Use the above example
  • e00c
    e00c Posts: 228 Forumite
    Yep ^^^ that's pretty much what I would have done. I was just in the middle of a HTML crisis so had no time to type it out :D

    Use the above example

    no probs!! theres a zillion different ways. but think something similar to that is "easy" enough.

    coding = the devil. I hate it.

    I'm more of a visual person!! lol
  • isofa
    isofa Posts: 6,091 Forumite
    Make sure you secure the directory with the script, otherwise someone can just come along and harvest your e-mail address and start spamming...
  • sparky7
    sparky7 Posts: 178 Forumite
    I use the Formmail script from http://www.tectite.com/formmailpage.php
    .. free and easy..
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.3K Banking & Borrowing
  • 253.6K Reduce Debt & Boost Income
  • 454.3K Spending & Discounts
  • 245.3K Work, Benefits & Business
  • 601.1K Mortgages, Homes & Bills
  • 177.5K Life & Family
  • 259.2K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.