Saturday, June 13, 2009

Website HTML building question. How do I get a form I have on my website to email info people put to myself?

It's just a form for Name, and email address. When they click the button below, I want it to email the information that they entered in the boxes to my email or anywhere else I could retrieve it. Thanks

Website HTML building question. How do I get a form I have on my website to email info people put to myself?
You basically have 2 choices:





1) Use an HTML mailto: link to use the CLIENT side email program to email it to you...


Syntax for this link in reference below...





2) Use a SERVER side script to email from the server... This would require access to the server to host the script for you. Samples in reference below...
Reply:Your webhost shoud have a formmail application in your CGI folder. Check your host's documentation for the details, but it's usually something like setting the fields up, declaring the form action, and declaring the input type. See the example text below, from Tiger Technologies: (You'll have to change the details to match your server.)





%26lt;form action="http://www.example.com/cgi-bin/F...


method="POST" enctype="application/x-www-form-urlencod...





%26lt;input type="hidden" name="recipient" value="webmaster"%26gt;


%26lt;input type="hidden" name="subject" value="example.com Feedback Form"%26gt;


%26lt;input type="hidden" name="required" value="realname,email"%26gt;





%26lt;!--


The hidden "redirect" and "missing_fields_redirect" items


are optional; if you use them, you must create the matching


pages.


--%26gt;


%26lt;input type="hidden" name="redirect"


value="http://www.example.com/form-submi...


%26lt;input type="hidden" name="missing_fields_redirect"


value="http://www.example.com/form-missi...





Your Name:


%26lt;input type="text" name="realname"%26gt;





Your E-Mail Address:


%26lt;input type="text" name="email"%26gt;





Number of Tigers You Own:


%26lt;select name="tigers"%26gt;


%26lt;option selected value"0"%26gt;None


%26lt;option value="1"%26gt;One


%26lt;option value="2"%26gt;Two


%26lt;option value="More than Two"%26gt;More than Two


%26lt;/select%26gt;





Comments:


%26lt;textarea name="comments" rows="3" cols="40"%26gt;%26lt;/textarea%26gt;





%26lt;input type="submit" value="Submit"%26gt;





%26lt;/form%26gt;
Reply:A shorter alternative to Jim W's answer:





%26lt;form action="mailto:email@email.com" method="post"%26gt;


Name: %26lt;br%26gt;


%26lt;input type="text" name="Name" value="required"%26gt;%26lt;br%26gt;


Email: %26lt;br%26gt;


%26lt;input type="text" name="Email" value="required"%26gt;%26lt;/p%26gt;


%26lt;input type="submit" value="Submit"%26gt;


%26lt;/form%26gt;





'value' stands for what text shows up in 1) the text box or 2) the submit button. Change email@email.com to whatever your email is.
Reply:just say the computer does not work


No comments:

Post a Comment