PHP contact form problem

Discussion in 'PHP' started by theivo, Sep 24, 2008.

  1. #1
    Hi ,
    I'm using simple contact email script for non-latin site which is UTF-8 encoding.

    Changed both contact.htm and process.php files to utf-8 enc.
    But when i'm receiving test emails Cyrillic charters are not shown properly.
    How to fix this ?

    This is my process.php file
    <?php
    $mymail = 'email@tosend.com';
    $cc = 'Online Form:';
    $BoDy = ' ';
    $FrOm .= 'Reply-To:' .$_POST['t3'];
    $BoDy .= 'Name: ';
    $BoDy .= $_POST['t1'];
    $BoDy .= "\n";
    $BoDy .= 'Phone: ';
    $BoDy .= $_POST['t2'];
    $BoDy .= "\n";
    $BoDy .= 'e-mail: ';
    $BoDy .= $_POST['t3'];
    $BoDy .= "\n";
    $BoDy .= 'subject: ';
    $BoDy .= $_POST['t4'];
    $BoDy .= "\n";
    $BoDy .= 'comment: ';
    $BoDy .= $_POST['t5'];
    $BoDy .= "\n";
    $send = mail("$mymail", "$cc", "$BoDy", "$FrOm");
    ///Redirect user to our homapage..
    if($send)
    {
    echo '<html><head>';
    echo '<meta http-equiv="refresh" content="0;URL=http://www.url-where-we-go/after-send.htm">';
    echo '</head><body>success!....';
    echo '</body></html>';
    }
    ?>
    Code (markup):
     
    theivo, Sep 24, 2008 IP
  2. eric_basher

    eric_basher Peon

    Messages:
    185
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this..


    
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    PHP:
     
    eric_basher, Sep 24, 2008 IP
  3. theivo

    theivo Well-Known Member

    Messages:
    238
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Thanks a lot , Eric!!! It works ! :)
     
    theivo, Sep 24, 2008 IP