PHP Ajax returns 404 error

Source: Internet
Author: User

<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>php Tutorial Ajax return 404 Error </title>

<body>
<script language= "Web Effects" >
var xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP");
Xmlhttp.open ("Post", "./upload.php", false);
Xmlhttp.setrequestheader ("Content-type", "multipart/form-data;");
Xmlhttp.setrequestheader ("Content-length", postlength);
Xmlhttp.send (package);
</script>

Code does not look wrong, return our output

alert (xmlhttp.status);

The return value is 404, looked up 404 is unable to find the file presented, in IIS is so dry, so the detailed check the principle is the path is wrong.

Xmlhttp.open ("Post", "./upload.php", false);

This file doesn't exist, ha.
</body>

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.