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 8943789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:52:25+00:00 2026-06-15T11:52:25+00:00

I hava 2 php files. index.php and preview.php in the top of index.php I

  • 0

I hava 2 php files. index.php and preview.php

in the top of index.php I have this code

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

When I try to load content to index.php from preview.php using:

function preview_content(id)
{

    var thebutton = '#previewButton';
    $(thebutton).hide();
    $('#preview_area').load('preview.php?id='+id);
}

the content loaded with characters like this M�laga CF

I tried to put the same utf-8 code in the top of preview.php but nothing changed. Is there any way to retrieve the content with UTF-8 charset?

  • 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-06-15T11:52:26+00:00Added an answer on June 15, 2026 at 11:52 am

    Please be sure about preview.php‘s encoding is UTF-8. Your editor’s default encoding applies newly created files but if you copied preview.php from somewhere else it’s encoding might be different. Also adding header('charset=utf-8'); as first line to preview.php might help. Like this;

    <?php
    header('charset=utf-8');
    // your code below here
    .
    .
    .
    

    You can also use .ajax() and specify contentType instead of .load();

    function preview_content(id)
    {
    
        var thebutton = '#previewButton';
        $(thebutton).hide();
        $.ajax({
            data: { "id" : id },
            type: "GET",
            url: "preview.php",
            contentType: "application/x-www-form-urlencoded;charset=UTF-8",
            success: function(output) {
                $('#preview_area').html(output);
            }
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hava a binary file like this : offset | size/type | Description -------+-----------+-----------------------------------------------------------
I hava a php variable that contain JSON type data. $list = [{id:10,first_name:first,mi_name:,last_name:last,nick_name:HH}]; and
I hava a function that looks something like this: require(config.php); function displayGta() { (...
I hava an absolute url in my stylesheet. http://localhost/images/myimage.jpg . I also have a
I hava text file full of values like this: The first line is a
Here's the thing. I hava a simple snippet in PHP like this regarding a
I hava a problem with this mssql_query in PHP : $query = 'SELECT Ville
I hava an activity which might have to load data when it's starting up.
i hava a c++ method(for java,jni) like follow,when i repeat call this from java
I hava a CSV file that I want to treat as source code. Essentially

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.