Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the garbled code from flash to php

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to deal with the garbled code from flash to php. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Flash value to php garbled solution: 1, view all the Flash code; 2, add "header ('Content-Type:text/html;charset=utf-8');" at the beginning of PHP.

This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer

Specific problem description:

The communication between PHP and Flash is all garbled.

No more nonsense, just go to the code.

The full code of PHP is as follows:

Test

The full code of Flash is as follows:

Import flash.events.MouseEvent;import flash.net.URLRequest;import flash.net.URLLoader;import flash.events.Event;var url:String = "http://localhost/testing.php";var req:URLRequest=new URLRequest (); bt.addEventListener (MouseEvent.CLICK,clickHd); function clickHd (e:MouseEvent) {req.url = url;req.method = URLRequestMethod.POST;var loaded:URLLoader=new URLLoader (); loaded.dataFormat = URLLoaderDataFormat.VARIABLES;loaded.addEventListener (Event.COMPLETE,completeHd); try {msg.text =" requesting data. " ;} catch (err:Error) {msg.text = "error, try again later";} loaded.load (req);} function completeHd (e:Event) {msg.text = e.target.DataX navigateToURL (req);}

There is a msg dynamic text box and bt button in flash

Solution:

Add at the beginning of PHP

This line is fine, where UTF-8 is the code, and you modify it according to the Flash code.

This is the end of this article on "how to deal with garbled codes from flash to php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report