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

  • SEARCH
  • Home
  • 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 5968809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:08:32+00:00 2026-05-22T20:08:32+00:00

i’m trying to use a tempalte system in php for a website I had.

  • 0

i’m trying to use a tempalte system in php for a website I had. anyways, everything is working ok so far, except for the encoding, when i render the website, is not taking the utf-8…

this is my empresa.php page code:

<?php
require_once 'template.class.php';

$view = new View();

$view -> title  = 'Empresa';
$view -> extra_css = '';
$view -> extra_js = '';
$view -> content = '
                        <div class="tituloP">Misión:</div>
                        <p class="marginP">
                        Procesar, envasar y comercializar alimentos de alta calidad cumpliendo y mejorando los estándares conocidos para satisfacer oportuna y plenamente las necesidades y expectativas de nuestros clientes.
                        </p> 
                        <div class="tituloP">Visión:</div>
                        <p class="marginP">
                        Ser una empresa innovadora y promotora del desarrollo de productos alimenticios de alta calidad y excelente imagen para sobrepasar las expectativas de nuestros clientes. Fortalecer nuestra competitividad para igualar a las empresas líderes, manteniendo una constante presencia y abriéndonos a nuevos mercados dentro del contexto local, regional, nacional y con proyecciones al mercado internacional.
                        </p>
                        <div class="tituloP">Historia:</div>
                        <p class="marginP">
                        En sus inicios nació como una empresa  dedicada solo a la distribución de encurtidos  obtenidos de terceros, entregados a un delimitado número de clientes. A medida que fue creciendo decidió emprender en el negocio de la producción y así nacieron los productos “mel®”, que hoy son parte de la empresa llamada <b>Agroindustria®</b> la que ha expandido su negocio a la elaboración de salsas, sucedáneo de jugo de limón  y que en el año 2003 adquirió la marca <b>Mos®</b>, marca conocida en el mercado nacional por más de 50 años.
                        </p>


                        <br /><div id="allproducts"></div><br /> 
                        <div id="lineapunteada"></div>
                        <a href="javascript:window.print()" id="impresora" class="printer">imprimir</a>
                        <br />
                    ';

echo $view -> render('template.php');

?>

this is my class:

<?php
class View {
     public function render($script) {
        ob_start();
        $this->_include($script);
        return ob_get_clean();
    }

    public function __get($key) {
        return (isset($this -> $key) ? $this -> $key : null);
    }

    protected function _include() {
        include func_get_arg(0);
    }
}
?>

andddd template.php:

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

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>Mos | <?php echo $this -> title; ?></title>

<link href="layout.css" rel="stylesheet" type="text/css" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<?php echo $this -> extra_css; ?>
<link rel="shortcut icon" href="/favicon.ico" />

<!--[if IE 6]>
    <script src="DD_belatedPNG_0.0.8a-min.js"></script>
    <script>
            DD_belatedPNG.fix('img, div');
    </script>
<![endif]--> 

<?php echo $this -> extra_js; ?>
</head>

<body>

    <div id="main">  
        <div id="container_black">
            <div id="container_white">

                <div id="container_header">

                    <div id="logo_top"></div>           
                    <div id="lineas_verticales_top">
                        <div class="volver_portada"><a href="index.php">Volver a portada</a></div>
                        <div class="english_spanish"><u>Español</u> | <a href="../en/index.php" class="english_spanish">English</a></div>
                    </div>
                    <div id="nav_bar_black"><div id="nav_bar_red"><div id="nav_bar_yel">

                        <ul class="menuholder"> 
                            <li class="menu_principal"><a href="#" title="Principal">Principal</a></li> 
                            <li class="menu_empresa"><a href="#" title="Empresa">Empresa</a></li> 
                            <li class="menu_productos"><a href="#" title="Productos">Productos</a></li> 
                            <li class="menu_clientes"><a href="#" title="Clientes">Clientes</a></li> 
                            <li class="menu_recetas"><a href="#" title="Recetas">Recetas</a></li> 
                            <li class="menu_contacto"><a href="#" title="Contacto">Contacto</a></li> 
                        </ul> 

                    </div></div></div>
                    <div id="topbg_degr"></div>

                </div>

                <div id="container_left">
                    <div id="conmargen_left_top"></div>
                    <div id="container_conmargen_left_middle">

                        <div class="top_title"><?php echo $this -> title; ?></div>
                        <div id="hrTitle"></div>


                        <?php echo $this -> content; ?>

                    </div>
                    <div id="conmargen_left_bottom"></div>

                    <!--[IF INDEX]
                    <div id="fono"></div>
                    <div id="dir"></div>
                    -->

                </div>

                <!--[IF INDEX]
                <div id="nav"></div>
                -->

                <div id="container_right">
                    <div id="conmargen_right_top"></div>
                    <div id="container_conmargen_right_middle">

                        <a href="#" id="recetas_poster" title="recetas"></a>


                        -->

                    </div>
                    <div id="conmargen_right_bottom"></div>
                </div>



                <br/>   

            </div> <!-- cierre del container white -->
        </div> <!-- cierre del container black -->

        <div id="footer">   
                <div class="footer_comment">
                    Agroindustria e.i.r.l. Todos los derechos reservados 2011
                </div>
        </div>

    </div> <!-- cierre del main -->
<br/>

</body>

</html>

anyways, everything seems to be working fine, but the á é í etc.. are not displaying im just getting ? mark.

Also any advice on my template system is welcome too

  • 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-22T20:08:33+00:00Added an answer on May 22, 2026 at 8:08 pm

    The editor you are using must save the empresa.php file in UTF-8 format (most likely it doesn’t, but uses ISO-8859-1, Windows-1252 or s/t similiar).

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I used javascript for loading a picture on my website depending on which small

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.