I highly recommend you forgive the naivity along with ignorance I’m therefore obviously displaying right here!
I’ve set up a form which often, upon the customer hitting the submit button, I wish to be e-mailed to an account provider that I stipulate. Is there a fairly easy addition to that html coding that might do this regarding me
I’ve tried to accomplish it in frontpage yet got a garbled message about " frontpage extensions may only be looked at when uploaded".
The use of php you incorporate the use of the technique below:
<
$to = "youyourdomain. com";
$subject = "your site - feedback";
$body = "< p> < font size='2' face='Verdana'> This what will be displayed in the mail... ";
$headers = "From: mailyoursite. com\n";
$headers . = "Content-Type: text/html; charset=iso-8859-1\n";
mail($to, $subject, $body, $headers);
echo "Thank you $_POSTname, your feedback has been presented... ";
>
Basically, the $to/$subject/$body ought to be obvious, the headers are exactly what displayed in the header belonging to the email, I’ve also added in the code int there for you youngster should be add html while in the body of this email, on your form for those who have a field called ‘name’ it can display ‘Thank people ‘name’, your feedback has been submitted… ‘
All that’s necessary to do will be change the variables to the own, so your current emails etc. This is certainly just very basic mail script and you can add to it in making it more protect etc.
Anticipation this helps
I you have’t got the choice to use PHP in your current hosting, you may make use of identical languages, such as ASP for just a similar result. HTML itself is unable to complete this operation by yourself, and so one more ‘programming’ language is needed.
Thanks Shaun plus Just – understand your help.
My personal host does help support php, so I guess We can just copy this script above (after editing naturally! ).
Once again, forgive my ognorance, but does this signify php (and this like) inout right website cannot possibly be previewed unless uploaded to some host
I usually apply Jack’s Formmail on my very own sites, it’s *usually* easy to begin:
http: //www. dtheatre. com/scripts/
Of course, you need to be able to upload PHP code to somewhat of a PHP server so that it to perform.
You could possibly, on the alternative hand, set up any PHP testing server in your home office PC if you want to be able to try without uploading.
Thank you…… I have one more question, which is making me really feel real stoooopid! I’ve set up quite a great form in html page, does the php code ought to be inserted into any kind of particular place Now i’m guessing it goes while in the " submit button" tags
Say your form web site was form. html code. You’d create the latest file called formhandler. php, and in the sort tag, you’d set the action. In ones case, you’d probably need to use something like that:
Inside form. html:
< sort name=" nameofform" method=" post" action=" formhandler. php" >
sort goes here
< /form>
Inside formhandler. php for each of the form fields, put similar to this:
$bodyofmail. = " Account of field just one: "; $formfield1 = $_POSTformfield1; $bodyofmail. = $formfield1; $bodyofmail. = " < br /> "; $bodyofmail. = " Account of field two: "; $formfield2 = $_POSTformfield2; $bodyofmail. = $formfield2; $bodyofmail. = " < br /> ";
To break down Shauns script much more, I’ll say precisely what each bit really does:
Here, you define that the mail will be from, and the subject:
$to = " youyourdomain. com"; $subject = " your blog - feedback";
I removed your body bit, because we created that earlier from the script, using the effects of your sort. Remember this:
$formfield1 = $_POSTformfield1;
That gets the field from the form, and converts it to your ‘variable’.
$bodyofmail. =
Thinking that whatever precedes your ". =" to the body of your email. notice your difference between = plus. = – in case we had merely used =, it would have overwritten every previous work!
At this point he sets in place the mail as well as tells the device to send the idea:
$headers = " Through: email=" mailyoursite. com" mailyoursite. com/email\n"; $headers. = " Content-Type: text/html; charset=iso-8859-1\n"; mail($to, $subject, $bodyofmail, $headers); reveal " Thank anyone $_POSTname, your feedback has been submitted... ";
Last but not least, Surrounded the full script with " <