Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Contact form for HTML
#1
Hey guys,
I have recently designed a website for someone but the issue is the contact form.. I have used the following code for the contact..
Code:
<form action="mailto:email@yahoo.com" method="post" id="sendemail">
          <ol><li>
            <label for="name">Name (required)</label>
            <input id="name" name="name" class="text" />
          </li><li>
            <label for="email">Email Address (required)</label>
            <input id="email" name="email" class="text" />
          </li><li>
            <label for="website">Website</label>
            <input id="website" name="website" class="text" />
          </li><li>
            <label for="message">Your Message</label>
            <textarea id="message" name="message" rows="8" cols="50"></textarea>
          </li><li>
            <input type="image" name="imageField" id="imageField" src="images/submit.gif" class="send" />
            <div class="clr"></div>
          </li></ol>
          </form>
When a client click on the submit button it opens the users email client like outlook express/thunderbird... Instead I want when the submit button is clicked it should send the email to the desired email address directly instead of through the email client..

I would appreciate if some one could help me through this! Smile
Thanks in advance.
[Image: IYOy9.png]
Reply
#2
You need to use PHP. Try these codes:

Incorporate this in your page;
HTML:

This below must be named 'send_form_email.php'
You must edit 2 lines for yourself (email and subject)
PHP:
Reply
#3
not working when I click on the submit button it takes me to : mysite.com/send_form_email.php which appears to be a blank page and the email is also not sent..
[Image: IYOy9.png]
Reply
#4
Did you put the PHP like I said into send_form_email.php ?
Reply
#5
(01-22-2012, 09:52 PM)Laugh Wrote: Did you put the PHP like I said into send_form_email.php ?

yes i did.. :\
[Image: IYOy9.png]
Reply
#6
You did something wrong, no reason it wouldn't work.
Reply
#7
Form action on your first code doesn't do anything but use the mailto:, which opens a mail client that you have installed like MS Outlook. You're not taking in any of the data from the form as variables.
Reply
#8
here is the link for the contact page :- http://yiinternational.com/contact.html
I think i have done everything right... would appreciate if anyone can solve my problem Smile
[Image: IYOy9.png]
Reply
#9
Alright, I didn't even have to take a look, your contact form is with extension .html, when it should be contact.php.

Wrong:
Code:
http://yiinternational.com/contact.html

Right:
Code:
http://yiinternational.com/contact.php
Reply
#10
oh yea, my bad... but its still the same http://yiinternational.com/contact.php
[Image: IYOy9.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Helping with HTML and CSS Ambitious 0 545 08-28-2011, 01:18 PM
Last Post: Ambitious
  [TUT] Contact Form using HTML/PHP Captain Straight Edge 29 5,482 08-17-2011, 09:49 AM
Last Post: -Infectious
  Anyone have any free HTML resources? Scalise 7 1,248 06-01-2011, 04:00 AM
Last Post: !LoL
  Mr. Doob :: HTML 5 Examples Gaijin 10 1,952 02-17-2011, 12:33 AM
Last Post: Gaijin
  Javascript Help. Form Submission. JohnRonder 0 777 02-01-2011, 11:12 AM
Last Post: JohnRonder

Forum Jump:


Users browsing this thread: 1 Guest(s)