Contact us Form, Config |
Contact us Form, Config |
soulassassin |
Mar 23 2011, 07:01 PM
Post
#1
|
Group: Members Posts: 3 Joined: 23-March 11 Member No.: 14,188 |
Hello, I purchased a template and am unable to figure out where to put in my email address in the HTML code. Anyone know what to do here? This is what the code looks like. Thanks
<form id="contacts-form" action=""> <fieldset> <div class="col-1"> <label>Enter Your Name:<br /><input type="text" value=""/></label> <label>Enter Your E-mail:<br /><input type="text" value=""/></label> </div> <div class="col-2"> Enter Your Message:<br /><textarea cols="" rows=""></textarea> <div class="alignright"><a href="#" class="link1" onclick="document.getElementById('contacts-form').reset()">clear ></a> <a href="#" class="link1" onclick="document.getElementById('contacts-form').submit()">submit ></a></div> </div> </fieldset> </form> </div> </div> </div> </div> <!-- box end --> |
jimlongo |
Mar 23 2011, 10:36 PM
Post
#2
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
This is the client side of the form. You need To configure the server side. Probably a perl or php script or some configuration file.
|
Darin McGrew |
Mar 23 2011, 10:55 PM
Post
#3
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Please see the FAQ entry How do I get form data emailed to me?
|
Brian Chandler |
Mar 24 2011, 12:39 AM
Post
#4
|
Jocular coder Group: Members Posts: 2,460 Joined: 31-August 06 Member No.: 43 |
But note that the <form> doesn't include an action, so it's not clear what the server-side script would be. (And this is the sort of murky javascript you _pay_ for?? What's the point of it?)
|
pandy |
Mar 24 2011, 02:02 PM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,733 Joined: 9-August 06 Member No.: 6 |
Yes, you should use a real submit button rather than use JavaScript to submit the form. And, as already said, to do it properly you need a script on the server to handle the form. Your only other option is mailto, and that's as bad as relying on JavaScript, if not worse.
I think you can find what you need to understand how this works in the Form part of the FAQ. http://htmlhelp.com/faq/html/forms.html#formstoc |
soulassassin |
Mar 25 2011, 06:56 PM
Post
#6
|
Group: Members Posts: 3 Joined: 23-March 11 Member No.: 14,188 |
You guys are awesome. Thank you (all of you). This site Rocks!!!! Hope I could return the favor one day. Thanks again
|
soulassassin |
Apr 9 2011, 03:01 AM
Post
#7
|
Group: Members Posts: 3 Joined: 23-March 11 Member No.: 14,188 |
Hello, I purchased a template and am unable to figure out where to put in my email address in the HTML code. Anyone know what to do here? This is what the code looks like. Thanks <form id="contacts-form" action=""> <fieldset> <div class="col-1"> <label>Enter Your Name:<br /><input type="text" value=""/></label> <label>Enter Your E-mail:<br /><input type="text" value=""/></label> </div> <div class="col-2"> Enter Your Message:<br /><textarea cols="" rows=""></textarea> <div class="alignright"><a href="#" class="link1" onclick="document.getElementById('contacts-form').reset()">clear ></a> <a href="#" class="link1" onclick="document.getElementById('contacts-form').submit()">submit ></a></div> </div> </fieldset> </form> </div> </div> </div> </div> <!-- box end --> OKAY these are the additional files you were all telling me about. <?php //-----------------Getting data sent by flash--------------------- foreach ($_POST as $key => $value){ if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){ $mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>'; $mail_body .= ''.stripslashes($value).'<br/>'; } } //----------------------------------------------------------------- $message = '<html><body>'.$mail_body.'</body></html>'; // mail body //------------if plain text is set to true removing html tags------ if ($_POST['plain_text']=='true') { $message = str_replace('<br/>',"\r\n", $message); $message = strip_tags($message); //------------------------------------------------------------------ } else { //----otherwise composing message headers--------------------------- $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=windows-1251' . "\r\n"; //------------------------------------------------------------------ } //------------setting conf data------------------------------------- $to = $_POST['mail_to']; $from = $_POST['mail_from']; $subject = $_POST['mail_subject']; $smtp_server = $_POST['smtp_server']; $smtp_port = $_POST['smtp_port']; //------------------------------------------------------------------ //---------setting header info-------------------------------------- $headers .= 'From:' .$from; //------------------------------------------------------------------ if (mail($to, $subject, $message, $headers)){ // sending mail print('&mail=1'); //succes } else { print('&mail=0');//failure } ?> AND <% '----function that removes html tags----------- Function RemoveHTML( strText ) Dim RegEx Set RegEx = New RegExp RegEx.Pattern = "<[^>]*>" RegEx.Global = True RemoveHTML = RegEx.Replace(strText, "") End Function '--------------------------------------------- '------defining script vars------------------- Dim mailObj, mailCfg, myBody, fld Dim RegEx set RegEx = New RegExp '-------------------------------------------- '------getting data sent by flash (filtering configuration data)------------ For Each fld in Request.Form If Request.Form(fld) <> "" and _ fld <> "mail_to" and _ fld <> "smtp_server" and _ fld <> "smtp_port" and _ fld <> "plain_text" and _ fld <> "mail_from" and _ fld <> "mail_subject" Then myBody = myBody & vbCRLF & " <b>" & fld & "</b> :<br/> " & Trim(Request.Form(fld)) & "<br/>" End If Next '--------------------------------------------------------------------------- '----------setting conf data------------------------------------------------ On Error Resume Next Set myMail = CreateObject("CDO.Message") myMail.Subject = Request.Form("mail_subject") myMail.From =Request.Form("mail_from") myMail.To = Request.Form("mail_to") '--------if plain text is set to true removing html--------------------------------------- if Request.Form("plain_text") = "true" then myMail.TextBody = RemoveHTML(myBody) '-------otherwise composing message body-------------------------------------------------- else myMail.HTMLBody = "<html><body>" & myBody & "</body></html>" end if '----------setting configuration params for smtp---------------------------------------------------------------------------------- myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Request.Form("smtp_server") myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = Request.Form("smtp_port") myMail.Configuration.Fields.Update '--------------------------------------------------------------------------------------------------------------------------------- myMail.Send '---------------sending message If Err = 0 Then Response.Write("&mail=1") 'if there the message is sent return 1 to flash Else Response.Write("&mail=0") 'otherwise return 0 End If %> So, what fields do I use? Its conf using PHP right? these web templates are a pain sometimes |
Lo-Fi Version | Time is now: 28th April 2024 - 03:57 AM |