Jump to content
php.lv forumi

Vajag palidzibu ar php mail formu


artix

Recommended Posts

Chainjiku intrese.

 

Ir php forma kas nosuta e-mail no 6-aja flasha ievaditiem input

fieldiem.Cik saprotu tad 6-ais flash tos datus suta kodetus UTF8

charseta...tas vinjam defaulta iestadits...

Charset mainja php nelidz...var apskatit attacha.

Ja nu kaut ka pielauzu ka ievaditais vards vai zinja atnak ar garumzimem ieksh

body tad heder`a(piem vards-no ka tas mails) tas ir ar keburiem un nemainigie ka piemeram - "vārds" ir izkroplots...vai otradak..."vārds" atnak bez keburiem...bet ievaditais teksts input fielda atnak keburains.

Bet lai raditos sutitaja vārds ar garumzīmēm headra- FROM...to neviena no variantiem nevar dabut.

Tad ka panakt lai no ta flash nosutita UTF8 teksta varetu izlobit tekstu atpakalj ar tam garumzimem un php forma atsuta mailu(vislabak plain text) ar garumzimem??

 

Un ko isti dara un ka strada mb_send_mail(),mb_language() it ka

ieteica lietot sito.

 

Ka un ar ko isti atskiras:

1)$name=utf8_decode($HTTP_POST_VARS['name']) ar $name = $HTTP_POST_VARS['Name'];

2)$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n" ar

$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";

 

Kapec viens ir bubult \?

 

Ko dara sis:

$message=urldecode($HTTP_POST_VARS['message'])

 

Liels padies.Paldies par pacietibu.]

 

Maila php izskats:

<?php

$message = $HTTP_POST_VARS['Message'];

$name = $HTTP_POST_VARS['Name'];

$email = $HTTP_POST_VARS['Email'];

$telephone = $HTTP_POST_VARS['Telephone'];

$name = stripslashes($name);

$email = stripslashes($email);

$message = stripslashes($message);

$rec_email = "info@domain.lv";

$subject = "Ziņa";

$header_info = "MIME-Version: 1.0\r\n";

$header_info .= "Content-type: text/plain; charset=windows-1257\r\n";

$header_info .= "X-Mailer: PHP/".phpversion()."\r\n";

$header_info .= "From: ".$name." <".$email.">\r\n";

$header_info .= "Reply-to: ".$name."<".$email.">\r\n";

$msg_body = "Vārds: $name\n";

$msg_body .= "E-pasts: $email\n";

$msg_body .= "Telefons: $telephone\n";

$msg_body .= "Teksts: $message\n\n\n";

$msg_body .= "Nosūtīts no IP: $REMOTE_ADDR\n

mail($rec_email, $subject, $msg_body, $header_info);

?>

Link to comment
Share on other sites

No manuāļa (jeb tev latvisi arī vajadzēs tulkot?):

utf8_decode -- Converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte ISO-8859-1.

urldecode -- Decodes URL-encoded string (Decodes any %## encoding in the given string)

 

Un kur tur ir kāds dubult \\ ? Neredzu. Tev es redzu tikai to, ka vienā vietā tu to iso-8859-1 liec pēdiņās, bet otrā vietā neliec.

Link to comment
Share on other sites

Paldies.

Bet tas daudz neko nelidz atrisinat manu problemu ar to mail formu un keburiem... :(

 

Kas varetu lidzet lai maila garumzimju vieta neraditos "?" bet normalas garumzimes?

PHP saturs:

$message = utf8_decode($HTTP_POST_VARS['Message']);

$name = utf8_decode($HTTP_POST_VARS['Name']);

$email = utf8_decode($HTTP_POST_VARS['Email']);

$name = stripslashes($name);

$email = stripslashes($email);

$message = stripslashes($message);

$rec_email = "kautkas@kads.lv";

$subject = "Subject";

$header_info = "MIME-Version: 1.0\r\n";

$header_info .= "Content-type: text/plain; charset=\iso-8859-4"\r\n";

$header_info .= "X-Mailer: PHP".phpversion()."\r\n";

$header_info .= "From: ".$name." \r\n";

$header_info .= "Reply-to: ".$name."\r\n";

$msg_body = "Vārds: $name\n";

$msg_body .= "E-pasts: $email\n";

$msg_body .= "Teksts: $message\n\n\n";

$msg_body .= "Nosūtīts no IP: $REMOTE_ADDR\n

mail($rec_email, $subject, $msg_body, $header_info);

Edited by artix
Link to comment
Share on other sites

×
×
  • Create New...