How do i make a form that doesn't open the e-mail client?

Reply

Join Date: Apr 2009
Posts: 12
Reputation: Atomika3000 is an unknown quantity at this point 
Solved Threads: 0
Atomika3000's Avatar
Atomika3000 Atomika3000 is offline Offline
Newbie Poster

How do i make a form that doesn't open the e-mail client?

 
0
  #1
Jul 3rd, 2009
i've made a website with a contact form, but everytime you click the send button it opens the computer default e-mail client. i know there is a way of doing this, but i dont know how.

I think it involves php and if it does can somebody show me how to do it, in simple terms (because i'm new to php),

HTML and CSS Syntax (Toggle Plain Text)
  1. <form action="mailto:mail@address.com" method="post" name="contact" id="contact">
  2. <table width="648" border="0" align="center">
  3. <tr>
  4. <td width="329" align="right"><div align="right">Title:</div></td>
  5. <td width="10" align="right">&nbsp;</td>
  6. <td width="300"><div align="left">
  7. <select name="title" id="title">
  8. <option>-- Select One --</option>
  9. <option>Mr</option>
  10. <option>Mrs</option>
  11. <option>Miss</option>
  12. <option>Ms</option>
  13. </select>
  14. </div></td>
  15. </tr>
  16. <tr>
  17. <td align="right"><div align="right">First Name:</div></td>
  18. <td align="right">&nbsp;</td>
  19. <td><div align="left">
  20. <input type="text" name="firstName" id="firstName">
  21. </div></td>
  22. </tr>
  23. <tr>
  24. <td align="right"><div align="right">Last Name:</div></td>
  25. <td align="right">&nbsp;</td>
  26. <td align="left"><div align="left">
  27. <input type="text" name="lastName" id="lastName">
  28. </div></td>
  29. </tr>
  30. <tr>
  31. <td align="right">&nbsp;</td>
  32. <td align="right">&nbsp;</td>
  33. <td>&nbsp;</td>
  34. </tr>
  35. <tr>
  36. <td align="right"><div align="right">Telephone:</div></td>
  37. <td align="right">&nbsp;</td>
  38. <td><div align="left">
  39. <input name="phone" type="text" id="phone" size="51">
  40. </div></td>
  41. </tr>
  42. <tr>
  43. <td align="right"><p align="right">E-Mail:</p></td>
  44. <td align="right">&nbsp;</td>
  45. <td><div align="left">
  46. <input name="e-mail" type="text" id="e-mail" size="51">
  47. </div></td>
  48. </tr>
  49. <tr>
  50. <td align="right"><div align="right"></div></td>
  51. <td align="right">&nbsp;</td>
  52. <td><div align="left"></div></td>
  53. </tr>
  54. <tr>
  55. <td align="right"><div align="right">Reason for Contacting:</div></td>
  56. <td align="right">&nbsp;</td>
  57. <td><div align="left">
  58. <select name="reason" id="reason">
  59. <option>-- Select One --</option>
  60. <option>General Enquiry</option>
  61. <option>Tips</option>
  62. <option>Commisioning</option>
  63. <option>Website Fault</option>
  64. </select>
  65. </div></td>
  66. </tr>
  67. <tr>
  68. <td align="right"><div align="right"></div></td>
  69. <td align="right">&nbsp;</td>
  70. <td><div align="left"></div></td>
  71. </tr>
  72. <tr>
  73. <td align="right" valign="top"><div align="right">Enquiry:</div></td>
  74. <td align="right">&nbsp;</td>
  75. <td><div align="left">
  76. <textarea name="enquiry" cols="48" rows="5" wrap="physical" id="enquiry"></textarea>
  77. </div></td>
  78. </tr>
  79. <tr>
  80. <td align="right" valign="top"><div align="right">
  81. <input type="submit" name="send" id="send" value="Send" a href="Contact.html" onClick="alert("You will now be redirected to your e-mail client")">
  82. </div></td>
  83. <td align="right">&nbsp;</td>
  84. <td><div align="left">
  85. <input type="reset" name="clear" id="clear" value="Clear">
  86. </div></td>
  87. </tr>
  88. </table>
  89. <label></label>
  90. <p>
  91. <label></label>
  92. </p>
  93. </form>

Need help ASAP please
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 130
Reputation: stevenpetersen is an unknown quantity at this point 
Solved Threads: 1
stevenpetersen's Avatar
stevenpetersen stevenpetersen is offline Offline
Junior Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #2
Jul 3rd, 2009
where do you want to send your information?
Steven Petersen
Web Designer / Web Master
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 12
Reputation: Magicianer is an unknown quantity at this point 
Solved Threads: 0
Magicianer Magicianer is offline Offline
Newbie Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #3
Jul 3rd, 2009
Right now you are using a mailto tag as the action for your form. If you want to use php, you need to have a php file as the action and use that php file to handle the information.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 12
Reputation: Atomika3000 is an unknown quantity at this point 
Solved Threads: 0
Atomika3000's Avatar
Atomika3000 Atomika3000 is offline Offline
Newbie Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #4
Jul 3rd, 2009
ok, it doesn't have to be php, all it has to do is send it to a specified e-mail address without opening the users default e-mail client and then needing them to press send.

If the only way is php, then so be it
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 12
Reputation: Magicianer is an unknown quantity at this point 
Solved Threads: 0
Magicianer Magicianer is offline Offline
Newbie Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #5
Jul 3rd, 2009
php is easiest using the mail() function. You can format the email message however you like.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #6
Jul 3rd, 2009
You can do it pretty easily in PHP with the mail() function. To do this though you would need to change the action attribute on your form tag to your PHP script. Then construct the message in PHP and use the mail() function to send it. For more on mail() see W3Schools and the PHP.net Reference.
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 19
Reputation: bbqkaren is an unknown quantity at this point 
Solved Threads: 0
bbqkaren bbqkaren is offline Offline
Newbie Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #7
Jul 22nd, 2009
You'd need to change your line to
HTML and CSS Syntax (Toggle Plain Text)
  1. <form action="filename.php" method="post" name="contact" id="contact">

the php code is in a separate file, a text file is what i use.

If you happen to host the site on godaddy, then have a basic php form already written and ready to use.

Otherwise you can start here
http://www.w3schools.com/php/php_forms.asp
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: How do i make a form that doesn't open the e-mail client?

 
0
  #8
Jul 29th, 2009
HTML and CSS Syntax (Toggle Plain Text)
  1. action="none"
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC