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!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

How do I set up a form on my website?

I did a web design course in 1999 and things have moved on somewhat since then.

I cannot find my course notes, but I bet they are of no use now, but I am trying to set up a very simple form for enquiries via my website.

Anyone able to offer any advice on where to start?

cheers

Welnik
Matched betting proceeds so far: £505.00

Comments

  • bingo_bango
    bingo_bango Posts: 2,594 Forumite
    Depends how your site works. Have a look at the W3 site HERE to see examples of html code based on your requirements, or HERE to have it done automatically.
  • Astaroth
    Astaroth Posts: 5,444 Forumite
    What are you wanting to happen when they hit the submit button on your form?

    The form itself is very basic HTML but doing something with the information they submit is a little more tricky - but there are plenty of free examples
    All posts made are simply my own opinions and are neither professional advice nor the opinions of my employers
    No Advertising or Links in Signatures by Site Rules - MSE Forum Team 2
  • welnik
    welnik Posts: 541 Forumite
    Astaroth wrote:
    What are you wanting to happen when they hit the submit button on your form?

    The form itself is very basic HTML but doing something with the information they submit is a little more tricky - but there are plenty of free examples

    Just something very basic. A general enquiry form.

    Your Name:*
    Location:*
    Email Address:*
    Phone Number:*
    Message:
    Please Complete Required Fields Marked *

    Ive made the actual form with boxes to be filled in, but I cannot remember for the life of me what to do next. In 1999 things seemed a bit simpler.
    Matched betting proceeds so far: £505.00
  • welnik
    welnik Posts: 541 Forumite
    cwoodham wrote:

    This one is only free if you allow ads to appear all over your website. Ive actually got the form its just what to do next which Im struggling with.

    thanks anyway
    Matched betting proceeds so far: £505.00
  • alanclose
    alanclose Posts: 2,226 Forumite
    I haven't tried this but it could be what you are looking for

    also this is very easy to follow
  • The best bet is to use the PHP scripting language to process your form. Something like this should do the trick, send me email if you need more help.

    $email = $HTTP_POST_VARS[email];
    $mailto = "email@address";
    $mailsubj = "Form submission";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS)) !! $mailbody .= "$key : $val\n"; }
    if (!eregi("\n",$HTTP_POST_VARS[/email][email])) !! mail($mailto, $mailsubj, $mailbody, $mailhead); }[/email]
  • If your web host is capable of running CGI scripts then try:

    Matt's FormMail - http://www.scriptarchive.com/formmail.htm

    or an enhanced version called NMS FormMail - http://nms-cgi.sourceforge.net/scripts.shtml
  • welnik
    welnik Posts: 541 Forumite
    The best bet is to use the PHP scripting language to process your form. Something like this should do the trick, send me email if you need more help.

    $email = $HTTP_POST_VARS[email];
    $mailto = "email@address";
    $mailsubj = "Form submission";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS)) !! $mailbody .= "$key : $val\n"; }
    if (!eregi("\n",$HTTP_POST_VARS[/email][email])) !! mail($mailto, $mailsubj, $mailbody, $mailhead); }[/email]


    Super, thanks for that. Do I just embed that into the code of my webpage? Do I then upload it into the relevant bit with my web page hoster? I use purplecloud and on their website it says

    The standard PHP installation is version 4.4.2.

    If you wish to use PHP5, you will need to either:

    Use the extension .php5 for your PHP scripts.
    Create a .htaccess file in the directory containing your PHP scripts. The .htaccess file should contain "AddHandler php5-cgi .php"

    This is all double dutch to me!
    Matched betting proceeds so far: £505.00
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
  • 353.8K Banking & Borrowing
  • 254.2K Reduce Debt & Boost Income
  • 455.2K Spending & Discounts
  • 246.9K Work, Benefits & Business
  • 603.4K Mortgages, Homes & Bills
  • 178.2K Life & Family
  • 260.9K 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.