Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 797197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:45:53+00:00 2026-05-14T22:45:53+00:00

I’m using PHP include to include a PHP file that has HTML in it.

  • 0

I’m using PHP include to include a PHP file that has HTML in it. some of the content has french accents and these show up as � on the site. How can this be solved?

Thanks

Here is the PHP file I include:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="en-us" http-equiv="Content-Language" />
<title>Accueil</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Changement créativité rêve buts être centré Plénitude personnel                                                                  Développement transformation Modification nouveauté avancement bien-être                    Nouvelle vision ressentis L’énergie positive satisfaction l’acceptation Pardon" name="keywords" />
<link href="masterstyles.css" rel="stylesheet" type="text/css" />
<link href="menustyles.css" rel="stylesheet" type="text/css" />
<link href="menudropdown.css" rel="stylesheet" type="text/css" />

<td class="tbsyles" >&nbsp;
        <h3 class="bigorange"> ACTIVITÉS À VENIR…</h3>
        <p class="horizblue"> </p>
        <p class="bigblack"> <br />
        Inscrivez-vous à nos conférences et formations
        <br />
        <br />
        </p>
        <h4 class="orange"> Example of some text that could be here<br />
        </h4>
        <p class="horizblue"> &nbsp;</p>
        <h3 class="bigorange"> <br />
        ABONNEZ-VOUS… </h3>
        <p class="nopadding"> À notre liste d’envoi </p>

    <form method="post" action="<?php echo $PHP_SELF;?>">
<?PHP
function process_info(){

     if(isset($_POST['email']))
 {

 $email=$_POST["email"];
   $email=strtolower($email);
    $action = "subc";

       // check if email exists

        // check whether email is correct (basic checking)
           $test1=strpos($email, "@");                                     //value must be >1
           $test2=strpos(substr($email,strpos($email,"@")), ".");          //value must be >1
           $test3=strlen($email);                                          //value must be >6
           $test4=substr_count ($email,"@");                               //value must be 1

 if ($test1<2 or $test2<2 or $test3<7 or $test4!=1)
             {

             print "<h6>Il a une erreur avec vôtre email</h6>";
             print "<h6>Aucune informations ont été envoyer</h6>";


             }
             else
             {
             print "<h5>vôtre address est enregistrer, Merci </h5>";


              //If they wanted to subsribe, do it...


             $file = "emaillist-666XXX.txt";

             // lets try to get the content of the file
if (file_exists($file)){
        // If the file is already in the server, its content is pasted to variable $file_content
        $file_content=file_get_contents($file);
}
else{
        // If the file does not exists, lets try to create it
        //   In case file can not be created (probably due to problems with directory permissions),
        //   the users is informed (the first user will be the webmaster, who must solve the problem).
        $cf = fopen($file, "w") or die("");
        fclose($cf);
}

// IF REQUEST HAS BEEN TO SUBSCRIBE FROM MAILING LIST, ADD EMAIL TO THE FILE
if ($action=="subc"){
        // check whether the email is already registered
        if(strpos($file_content,"<$email>")>0){die("");}
        // write the email to the list (append it to the file)
        $cf = fopen($file, "a");
        fputs($cf, "\n$email");       // new email is written to the file in a new line
        fclose($cf);

}
}
}
}


process_info();


?>


            &nbsp;<p class="nopadding">Votre Courriel</p>
            <input name="email" type="text" class="style3" />
                    <input name="Submit" type="submit" value="OK" /></form>

                <p class="horizblue"></p>
                <h3 class="bigorange"> <br />
                OUTILS GRATUIT… </h3>
                <p class="nopadding">Amusez-vous avec des outils intéressants</p>   
        </td>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:45:53+00:00Added an answer on May 14, 2026 at 10:45 pm

    That happens if the browser thinks your using another encoding than you actually use.

    try to add the following in your php file before any html is printed:

    header ('Content-type: text/html; charset=utf-8');
    // or
    header ('Content-type: text/html; charset=iso8859-15');
    

    and add

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

    between the <head></head> tags

    UPDATE: just saw your update with the file. you need to add header ('Content-type: text/html; charset=utf-8');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 451k
  • Answers 452k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Andy's answer is definitely correct, but I want to expand… May 15, 2026 at 9:03 pm
  • Editorial Team
    Editorial Team added an answer Maybe you should read this, before looking for a way… May 15, 2026 at 9:02 pm
  • Editorial Team
    Editorial Team added an answer If fast-app switching is working on the app as part… May 15, 2026 at 9:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.