Jump to content

Why wont php form send out correctly???


sk8ertim

Recommended Posts

Hi everyone, I have a problem with a send out form threw HTML/PHP.I have a problem with the check boxes sending out.sitehelpkw8.th.jpgSo I fill everything out, I filled it out in English and RUssian, but this site it used only in Russian language.sitehelp1gl7.th.jpgAnd this it the email I get in my Horde mailbox sitehelp2um3.th.jpgFirst offWhy do I get the Number code that I put in the red boxes for my Russian letter? And how can I fix that?AlsoWhy do I get empty Smena[1], [2], [3], and [4]? And how can I fix that?

<?php$to = "admin@skating-camp.com";$from = $_REQUEST['surname'];$name = $_REQUEST['firstname'];$headers = "From: $admin@skating-camp.com";$subject = "Web Contact Data";$fields = array();$fields["firstname"] = "firstname";$fields["surname"] = "surname";$fields["birthday"] = "birthday";$fields["team"] = "City where skates";$fields["polis_nom"] = "polis_nom";$fields["polis_do"] = "polis_do";$fields["sport_polis_nom"] = "sport_polis_nom";$fields["sport_polis_do"] = "sport_polis_do";$fields["parent_name"] = "Parent name";$fields["passport"] = "passport";$fields["address"] = "address";$fields["phone"] = "phone";$fields["level"] = "level";$fields["email"] = "email";$fields["smena[1]"] = "smena[1]";$fields["smena[2]"] = "smena[2]";$fields["smena[3]"] = "smena[3]";$fields["pribitie"] = "pribitie";$fields["otezd"] = "otezd";$fields["addinfo"] = "addinfo";$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }if($firstname == '') {print "Вы не вставели своё имя.";}else if($name == '') {	print "You have not entered a name, please go back and try again";}else $send = mail($to, $subject, $body, $headers);if($send) {	header("Location: http://www.skating-camp.com/index.html");}else {	print "We encountered an error sending your mail, please notify admin@skating-camp.com";}?>

Thats my PHPThanks in advanceTIm

Link to comment
Share on other sites

Well, I guess no one cares.
People on this forum have different schedules then you do, and we answer questions when we can. Some threads take days to get an answer. Some threads have to wait until someone is available. Normally I'm in Arizona and answer questions there at work or at home, right now I'm in Maryland and I'm on a totally different schedule. People answer questions when they can.
Why do I get the Number code that I put in the red boxes for my Russian letter? And how can I fix that?
You are sending the email as plain text. You are sending the Russian letters as HTML codes. If you want the HTML codes to show as HTML characters, then you need to send an HTML email, not a plain text email.
Why do I get empty Smena[1], [2], [3], and [4]? And how can I fix that?
It's hard to tell without seeing the code for your form. Matpatnik's suggestion would probably help, if you change the names be static instead of array elements then that will probably fix it. Without seeing the form code it's hard to tell. But if your form fields are an array then a foreach loop with the field names won't pick up those array elements.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...