Php_xmlhttp garbled Problem Solving method _php Tutorial

Source: Internet
Author: User
Tags php server
Resin in the new version began to support PHP, I feel more fun, is too lazy to configure a group of Apache_php_mysql on their own machine, after all, Java-based to do things. So will own a PHP site directly resin inside do development, the overall feeling is good, the basic function did not find the problem, but in the process of continued optimization, thought of XMLHTTP, then readily wrote a few files to try, no refresh effect, but unexpectedly encountered a Chinese garbled, So 511 days to toss this, also in the middle from the site to see some of the current on the Earth some of the quarrel and noisy things, China and the United States to see the plate, a moment along this side said, a will follow over there, there are some meaning, just think, China's 80 after the end of these people will become what look, by eating 6 The 70 's earned the Ben alive, but also to enjoy the glory, the key is also complacent, this kind of people is not the legendary garbage? Too lazy to say, or read garbled it
There are three files, one is HTM, one is PHP, the other is js,js used in htm, PHP is the server.
a.htm
Copy CodeThe code is as follows:

<title></title>










A.js
Copy CodeThe code is as follows:
function Getxmlhttprequest () {
var xmlHttp;
if (window. ActiveXObject) {
try{
XmlHttp = new ActiveXObject ("MSXML2. XMLHTTP ");
}catch (e) {
try{
XmlHttp = new ActiveXObject ("Microsoft.XMLHTTP");
}catch (e) {
XmlHttp = false;
}
}
}else{
try{
XmlHttp = new XMLHttpRequest ();
}catch (e) {
XmlHttp = false;
}
}
if (!xmlhttp) {
return false;
}else{
return xmlHttp;
}
}
function Ajax () {
This.url;
This.params = "";
This.parseparameters = function (thisform) {
for (var i = 0; i < thisform.elements.length; i++) {
var e = thisform.elements[i];
This.params + = (e.name + "=" + E.value);
if (i! = (thisform.elements.length-1))
This.params + = "&";
}
};
Ajaxobj = Getxmlhttprequest ();
Ajaxobj.onreadystatechange = ProcessRequest;
This.post = function () {
Ajaxobj.open ("Post", This.url, True);
Ajaxobj.setrequestheader (' Content-type ', ' application/x-www-form-urlencoded; Charset=utf-8 ');
if (This.params.length > 0)
Ajaxobj.send (This.params);
Else
Ajaxobj.send ();
}
}
function ProcessRequest () {
if (ajaxobj.readystate = = 4) {
if (Ajaxobj.status = = 200) {
if (Ajaxobj.responsetext! = "") {
document.getElementById ("Show"). InnerHTML = "";
document.getElementById ("Show"). InnerHTML = Ajaxobj.responsetext;
}
}else{
Alert ("Exception.");
}
}else{
document.getElementById ("Show"). Innerhtml= "Loading ...";
}
}

a.php
Copy CodeThe code is as follows:
Header ("content-type:text/html; Charset=utf-8 ");
$name = $_post[' name '];
Echo $name;
?>

All use Utf-8 write storage, but dead or alive is not, always said there is a problem, always come out garbled, a day down, head dizzy drops, at noon, arm tied 3kg sandbags, badminton racket waved 200, muscle a little swelling feeling, well, show that there is exercise effect, over some Tian Deng paid to buy a practice pat, I commonly used at700 about 90g, practice pat around 160g, should have a practice effect bar, but the right arm to see than the left arm thicker, it seems to need a large bar, the left arm also practiced a good

After dinner, rage, put this three files on a PHP server, a try, completely normal, no garbled, I, I do not say, it seems to be the reason for resin, stay will look for, look at Quercus have not the latest version, is not able to support the better some.

http://www.bkjia.com/PHPjc/320420.html www.bkjia.com true http://www.bkjia.com/PHPjc/320420.html techarticle resin in the new version began to support PHP, I feel more fun, is too lazy to configure a group of Apache_php_mysql on their own machine, after all, Java-based to do things. So will ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.