Reply to XMLHttpRequest not posting data to php

Your name:

Reply:


Posted by adamsbarker on 02/11/06 10:05

i have the following javascript code:

---------

try{F=new ActiveXObject("Msxml2.XMLHTTP")}
catch(e)
{
try{F=new ActiveXObject("Microsoft.XMLHTTP")}
catch(e){F=typeof "XMLHttpRequest"!="undefined"?new
XMLHttpRequest():0}
}

if(F)
{
F.open("POST","http://www.myurl.com/php_page")

F.onreadystatechange=function(){F.readyState==4?eval(F.responseText):0}

F.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
F.send("foo=bar&stuff=test")
}

--------

when i run this in firefox 1.5 the "post" fields are recognised by php,
however, when i use internet explorer 6.0 the "post" fields are not
recognised by php. i have checked the headers sent in IE and they
appear to be correct (eg, Content-Type =
application/x-www-form-urlencoded"...). as suggested in another post, i
have enabled the "always_populate_raw_post_data" directive in my
php.ini file, yet the "post" fields still don't exist.. also, when
running phpinfo() on the page that is being posted to,
$_SERVER["REQUEST_METHOD"] = "GET" - something is wrong here. is it
something to do with the the script above, the browser or the server?

thanks for any help,
adam.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация