Hi, I've been spending hours looking but only found oen rather ugly looking form so I thought I'd ask here and see if anyone could suggest anything. I want a 'send me a message' form for the 'contact me' page of my website. All it needs is a name field, and email filed, and a large field for any feedback, question or message - and a submit button to send the message to me. I have been looking at Javascript but I really don't mind what the basis of the code is so long as it looks nice and slick and works. Any suggestions, links, etc much appreciated. Thanks, Phil
why dont you just customise it your self......... for example if you look at my site http://www.biomedicalscientist.info and scroll to the bottom right - it is customised to the page. This is just a simple html form with javascript delivery behind it. I can let you have the entire script for $5 but really its not hard.
If you do a free google search for something like PHP contact form, or HTML contact form. Personally I think the best thing is to use PHP (obviously you require a PHP compatibile server).If you want one, I've got a spare one hanging around, which I can upload somewhere, but to be honest, you are probably best making your own, so it is more customizable. Alternativley, you could use W3's Site to find some contact forms.
Be careful, some of this free scripts are easy to use to hack your site, dont just use any free script. I need a safe script also, any recommendations ? What script is used on www.biomedicalscientist.info ?
Contact_Us.php: <?php if (isset($_POST['submit'])) { $to = "me@localhost"; // change this to the recipient's email address $headers = "From: Site Visitor\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $subj = "Inquiry"; $details = "Name: ".$_POST['contact']."\n"; $details .= "Email: ".$_POST['email']."\n"; $details .= "Message:\n".$_POST['message']; mail($to, $subj, $details, $headers); header("Location: thankyou.html"); // create a thankyou.html page in the same folder exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Inquiry Form</title> <script type="text/javascript"> function validate(nForm){ for (i=0; i<3; i++) {if (nForm[i].value == ""){alert('Please complete all fields');return false}} } </script> <style type="text/css"> form {width:300px;margin:auto;padding-top:30px} fieldset {padding:5px;background-color:#f0fff0;border:1px solid #87ceeb} legend {font-size:14pt;color:#00008b;background-color:#87ceeb;padding-left:3px;padding-right:3px;margin-bottom:5px;} label {font-size:12pt;color:#00008B;padding:5px} .submitBtn {font-family:tahoma;font-size:10pt;display:block;margin-left:auto;margin-right:auto;margin-top:5px;margin-bottom:5px} </style> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onsubmit="return validate(this)"> <fieldset> <legend>Inquiry</legend> <label> Name: <input type='text' name='contact' size='30'></label> <br> <label>Email: <input type='text' name='email' size='30'></label> <br> <label>Message: <br> <textarea name='message' rows='4' cols='30' style='overflow:auto;margin-left:12px'></textarea> </label> <input type='submit' name="submit" value="Submit" class="submitBtn"> </fieldset> </form> </body> </html> Code (markup):
I know it's probably not what you want, but should you choose to write your own, these would be great scripts to use as inspiration (or just use them as is, your call). http://green-beast.com/blog/?page_id=71 http://www.dustindiaz.com/ajax-contact-form/
You can use Ajax contact us form which look good as well as don't require pageload to send form. However if you want everything easy and more pretty to look then use online form creator like jotform
why have you taken hours? all you need is a sendform script, there are millions out there from CGI to ASP to PHP to .Net a basic .net would be something like: Dim strKeys As String() Dim strValues As String() Dim strQs As String = "" strKeys = Request.Form.AllKeys Dim i As Integer = 0 While i < Request.Form.Count strValues = Request.Form.GetValues(i) Dim j As Integer = 0 While j <= strValues.GetUpperBound(0) If Not ((strKeys(i) = "__VIEWSTATE") Or (strKeys(i) = "__EVENTVALIDATION")) Then strQs += strKeys(i).Replace("_", " ") + " = " + strValues(j) + vbCrLf + vbCrLf End If System.Math.Min(System.Threading.Interlocked.Increment(j), j - 1) End While System.Math.Min(System.Threading.Interlocked.Increment(i), i - 1) End While If strQs.Length > 0 Then strQs = strQs.Substring(0, strQs.Length - 1) End If Const emailto As String = "your@email.com" Dim emailsubject As String = "New Feedback " Dim emailbody As String = strQs Dim emailMessage As New System.Net.Mail.MailMessage(emailto, emailto) emailMessage.Subject = emailsubject emailMessage.Body = emailbody emailMessage.IsBodyHtml = False Dim smtpmail As New System.Net.Mail.SmtpClient smtpmail.Send(emailMessage) emailMessage.Dispose() Response.Redirect("~/thankyou.aspx") Code (markup): A little long winded but as it doesnt call any of the names of the form elements you can easily add or minus fields on the form over time without having to change the script.
I know. But the OP (or someone reading this thread in the future) may not know that, so I reiterated it for the benefit of those who do not know.
I'd recommend something php based. if you want something really quick can use a service like: http://www.emailmeform.com/