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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:24:39+00:00 2026-06-10T00:24:39+00:00

I’m far from an expert in PHP and I’m struggling to resolve an issue

  • 0

I’m far from an expert in PHP and I’m struggling to resolve an issue that I’m having here.

What I’m doing is pulling core information from this URL:
http://us.battle.net/wow/en/arena/kelthuzad/3v3/W%C3%BCstenfuchs%20zu%20gro%C3%9F/

In AS3 this provides me with the following, from the team name:

http://us.battle.net/wow/en/arena/kelthuzad/3v3/W%C3%BCstenfuchs%20zu%20gro%C3%9F/

Now, this is fine. If I decodeURI it, it gives me:

http://us.battle.net/wow/en/arena/kelthuzad/3v3/Wüstenfuchs zu groß/

My issue comes when I’m sending the information from AS3 to PHP. I’m doing it with encoding intact, however no matter what I try PHP is reading the code incorrectly. This is the output:

var9=http://us.battle.net/wow/en/arena/kelthuzad/3v3/Wüstenfuchs zu groÃ/

Even when I try to decode this, it gives the exact same output. If I send it from AS3 to PHP already decoded, it again gives the same result as above.

My code for AS3 is:

var phpVars:URLVariables = new URLVariables();            

phpVars.team = _team;

urlRequest.method = URLRequestMethod.POST;
urlRequest.data = phpVars;

urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
urlLoader.addEventListener(Event.COMPLETE, returnResult);
urlLoader.load(urlRequest);

My code for PHP is:

header("Content-type: text/html; charset=utf-8");
    function updateData(){    
         $team2 = mysql_real_escape_string($_POST['team']);
         echo("var9=".$team2);
         $sql = "INSERT INTO title_test SET field1='$team2'";
         mysql_query($sql);
     }

This puts into the database:

http://us.battle.net/wow/en/arena/kelthuzad/3v3/Wüstenfuchs zu groß/

It’s also worth noting that I’m trying to do a query with the $team2 data within PHP that is also failing, as it is not encoding correctly.

What step am I missing here?

Edit: utf-8 is enabled on the DB.

  • 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-10T00:24:39+00:00Added an answer on June 10, 2026 at 12:24 am

    Okay, after much heartache and many headaches, I have now got this to work… However the method that makes it work seems very strange and not best practise.

    AS3 is now:

    var phpVars:URLVariables = new URLVariables();            
    
    phpVars.team = decodeURI(_team);
    
    urlRequest.method = URLRequestMethod.POST;
    urlRequest.data = phpVars;
    
    urlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    urlLoader.addEventListener(Event.COMPLETE, returnResult);
    urlLoader.load(urlRequest);
    

    PHP is now:

    $team2 = ($_POST['team']);
    echo("var9=".$team2);
    $sql = "INSERT INTO title_test SET field1='$team2'";
    mysql_query($sql);
    

    Connect.php is now

    mysql_connect($db_host, $db_username, $db_password, $db_name);
    
    mysql_query('SET NAMES utf8'); 
    
    mysql_select_db($db_name) or die (mysql_error());
    

    This now correctly returns information into the database and allows the URL queries to work. The echo’d information back into Flash still shows incorrectly, though.

    I’ll leave this open, as I’m certain that this method is incorrect. I’m almost certain that you should leave it encoded going out of AS3 and unencode it in PHP.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a view passing on information from a database: def serve_article(request, id): served_article
I'm trying to create an if statement in PHP that prevents a single post
That's pretty much it. I'm using Nokogiri to scrape a web page what has
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

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.