Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    2
    Member #
    37120

    Post Where to place UTF 8 unicode in PHP post file?

    Hello,
    When I fulfill the application form with Azerbaijani (Turkish) alphabet and submit, it sends to my e-mail successfully, but it doesn't read the letters clearly. I want to write UTF 8 unicode in php post file, but actually I don;t know where to write it, I tried it lots of time, but it was unsuccessful. Could you please help me out in this matter? Thanks in advance.

    <?php

    $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

    // Checkbox handling
    $field_27_opts = $_POST['field_27'][0].",". $_POST['field_27'][1].",". $_POST['field_27'][2].",". $_POST['field_27'][3].",". $_POST['field_27'][4].",". $_POST['field_27'][5].",". $_POST['field_27'][6].",". $_POST['field_27'][7].",". $_POST['field_27'][8].",". $_POST['field_27'][9].",". $_POST['field_27'][10].",". $_POST['field_27'][11];

    // File upload handling
    if($_FILES['field_51']['name']!=''){
    $field_51_filename = "file_51_".date("sihdmY").substr($_FILES['field_51']['name'],strlen($_FILES['field_51']['name'])-4);
    if(!move_uploaded_file($_FILES['field_51']['tmp_name'], "./files/".$field_51_filename)){
    die("File " . $_FILES['field_51']['name'] . " was not uploaded.");
    }
    }

    // File upload handling
    if($_FILES['field_52']['name']!=''){
    $field_52_filename = "file_52_".date("sihdmY").substr($_FILES['field_52']['name'],strlen($_FILES['field_52']['name'])-4);
    if(!move_uploaded_file($_FILES['field_52']['tmp_name'], "./files/".$field_52_filename)){
    die("File " . $_FILES['field_52']['name'] . " was not uploaded.");
    }
    }

    // File upload handling
    if($_FILES['field_53']['name']!=''){
    $field_53_filename = "file_53_".date("sihdmY").substr($_FILES['field_53']['name'],strlen($_FILES['field_53']['name'])-4);
    if(!move_uploaded_file($_FILES['field_53']['tmp_name'], "./files/".$field_53_filename)){
    die("File " . $_FILES['field_53']['name'] . " was not uploaded.");
    }
    }

    // File upload handling
    if($_FILES['field_54']['name']!=''){
    $field_54_filename = "file_54_".date("sihdmY").substr($_FILES['field_54']['name'],strlen($_FILES['field_54']['name'])-4);
    if(!move_uploaded_file($_FILES['field_54']['tmp_name'], "./files/".$field_54_filename)){
    die("File " . $_FILES['field_54']['name'] . " was not uploaded.");
    }
    }

    // File upload handling
    if($_FILES['field_55']['name']!=''){
    $field_55_filename = "file_55_".date("sihdmY").substr($_FILES['field_55']['name'],strlen($_FILES['field_55']['name'])-4);
    if(!move_uploaded_file($_FILES['field_55']['tmp_name'], "./files/".$field_55_filename)){
    die("File " . $_FILES['field_55']['name'] . " was not uploaded.");
    }
    }

    // File upload handling
    if($_FILES['field_56']['name']!=''){
    $field_56_filename = "file_56_".date("sihdmY").substr($_FILES['field_56']['name'],strlen($_FILES['field_56']['name'])-4);
    if(!move_uploaded_file($_FILES['field_56']['tmp_name'], "./files/".$field_56_filename)){
    die("File " . $_FILES['field_56']['name'] . " was not uploaded.");
    }
    }

    mail("attachment@madad.net","Telimci vezifesinde calismaq ucun Muraciet formasi","Form data:

    Mraciət etdiyiniz vəzifə: " . $_POST['field_1'] . "
    Ad: " . $_POST['field_2'] . "
    Soyad: " . $_POST['field_3'] . "
    Doğum tarixi: " . $_POST['field_4'] . "
    nvan: " . $_POST['field_5'] . "
    Faktiki yaşadığınız şəhər/rayon: " . $_POST['field_6'] . "
    Qeydiyyatda olduğunuz şəhər/rayon: " . $_POST['field_7'] . "
    Email: " . $_POST['field_8'] . "
    Mobil telefon: " . $_POST['field_9'] . "
    Ev telefonu: " . $_POST['field_10'] . "
    Əlavə nmrə: " . $_POST['field_11'] . "
    Təhsil aldığınız məssisənin tam adı: " . $_POST['field_12'] . "
    İllər: " . $_POST['field_13'] . "
    Təhsilinizi təsdiq edən sənəd: " . $_POST['field_14'] . "
    İxtisas dərəcəsi: " . $_POST['field_15'] . "
    İxtisas: " . $_POST['field_16'] . "
    İxtisasartırma kursları: " . $_POST['field_17'] . "
    Məssisə: " . $_POST['field_18'] . "
    Mvzu: " . $_POST['field_19'] . "
    Mddət (il və aylar qeyd edilməklə): " . $_POST['field_20'] . "
    Bitirdiyi kursu təsdiqləyən sənəd: " . $_POST['field_21'] . "
    İş yeri: " . $_POST['field_22'] . "
    Vəzifə: " . $_POST['field_23'] . "
    Şəhər /rayon: " . $_POST['field_24'] . "
    Mddət (ay və illər qeyd edilməklə): " . $_POST['field_25'] . "
    İxtisasınız və ya tədris etdiyiniz fənn zrə Yeni Təhsil Proqramını (Yeni fənn kurikulumlarını) tətbiq edirsinizmi?: " . $_POST['field_26'] . "
    Tətbiq edirsinizsə aşağıdan mvafiq olanı sein: $field_27_opts
    Təlimi kimi işləmisinizmi?: " . $_POST['field_28'] . "
    Məssisə: " . $_POST['field_29'] . "
    Coğrafi məkan: " . $_POST['field_30'] . "
    Mddət (ay və illər qeyd edilməklə): " . $_POST['field_31'] . "
    Təlimin adı və/və ya mvzusu: " . $_POST['field_32'] . "
    Hədəf qrup: " . $_POST['field_33'] . "
    İş yeri: " . $_POST['field_34'] . "
    Vəzifə: " . $_POST['field_35'] . "
    Şəhər /rayon: " . $_POST['field_36'] . "
    Mddət (ay və illər qeyd edilməklə): " . $_POST['field_37'] . "
    Adı və/və ya mvzusu: " . $_POST['field_38'] . "
    Ay/il: " . $_POST['field_39'] . "
    Təlimi təşkil edən məssisə: " . $_POST['field_40'] . "
    Məssisə: " . $_POST['field_41'] . "
    Təsdiqləyən sənəd: " . $_POST['field_42'] . "
    İngilis dili: " . $_POST['field_43'] . "
    Rus dili: " . $_POST['field_44'] . "
    Azərbaycan dili: " . $_POST['field_45'] . "
    Sərbəst İşləyə bildiyiniz kompter proqramlarını qeyd edin: " . $_POST['field_46'] . "
    Hansı tarixdən təlimi kimi fəaliyyətə başlaya bilərsiniz? (tarix və ay qeyd edilməklə): " . $_POST['field_47'] . "
    Gnn hansı vaxtında işləyə bilərsiniz?: " . $_POST['field_48'] . "
    İl ərzində hansı aylarda işləyə bilərsiniz?: " . $_POST['field_49'] . "
    Hansı nv təlim(lər)ə təlimi kimi cəlb olunmaq istərdiniz?: " . $_POST['field_50'] . "
    CV-niz: ".$where_form_is."files/".$field_51_filename." (original file name: " . $_FILES['field_51']['name'] . ")
    Şəkliniz: ".$where_form_is."files/".$field_52_filename." (original file name: " . $_FILES['field_52']['name'] . ")
    Sertifikatlarınızın elektron nsxəsi (əgər varsa): ".$where_form_is."files/".$field_53_filename." (original file name: " . $_FILES['field_53']['name'] . ")
    Diplomunuzun elektron nsxəsi: ".$where_form_is."files/".$field_54_filename." (original file name: " . $_FILES['field_54']['name'] . ")
    Şəxsiyyət vəsiqənizin elektron nsxəsi: ".$where_form_is."files/".$field_55_filename." (original file name: " . $_FILES['field_55']['name'] . ")
    VEN-in elektron nsxəsi (əgər varsa): ".$where_form_is."files/".$field_56_filename." (original file name: " . $_FILES['field_56']['name'] . ")



    ");

    include("confirm.php");

    ?>

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    Are you wantig to submit the text in UTF8 to the DB Or the mail ? Kind of confused ... Guessing its both... If your page that your form on is set to UTF8 language... Its going to submit it in UTF8.

    bit you've got several things going on here...

    1. A DB, if the language identifier on the Actual DB is not set, it doesn't matter what you send it...

    2. SMTP mail... Just sends what you provide... So if you don't specify a language identifier ( character code set ), it should default to the users ( in US, that typically is UTF8, in Asia and some eu areas it will be UTF7 to handle kanji characters... Which turn into "blocks" if sent to a UTF8 defined DB.

    3. Your mail program reading the email... If it is set to a local language setting ( not UTF8 ), it doesn't matter what you're sending it, it won't display correctly unless its the same character code.

    Make sure the FORM is defining the character codes as UTF8 ( in your head section )

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    make sure our DB is set to accept UTF8, then check you mail program language settings ( might be defined in your PC's regional settings ), but some mail programs can handle multiple settings...

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Moved to PHP forum.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Junior Member johannawilliams's Avatar
    Join Date
    Aug 2013
    Location
    New York
    Posts
    4
    Member #
    37087
    Unicode can be set up easily by following the steps mentioned below:

    Set the correct meta for example in HTML use:
    <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
    Make sure PHP is set up to use Unicode, it is usually is.
    Make sure to use UTF-8 while making the database and the inner fields.

  6. #5
    Junior Member
    Join Date
    Sep 2013
    Posts
    3
    Member #
    37131
    Unicode has to be placed in the Meta tag.

    eg.
    <meta charset="utf-8">
    And make sure you put the meta tag in the HTML head tag.

  7. #6
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Thread closed. WZ has already answered it conclusively and no one's adding anything.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:34 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com