PHP: Ajax send()

From: Date: Fri, 22 Feb 2008 16:33:26 +0000
Subject: PHP: Ajax send()
Groups: php.general 
Request: Send a blank email to php-general+get-269883@lists.php.net to get a copy of this message
Hi!! Im trying to sent data to and php with Ajax, so.. this is what im sending>_url= "table='historia'$'='$''$'string'$''&"; then i do: _url = _url.substring(0,_url.length-1) //quita el & de sobra al final var ajax = nuevoAjax(); ajax.open("POST", "atrapalo_x.php", true); ajax.setRequestHeader("Content-Type", "aplication/x-www-form-urlencoded"); ajax.send(_url); ajax.onreadystatechange = function() { if(ajax.readyState == 4) { alert(ajax.responseText) . . . .............. and in the php i do: $datafield=explode("$",str_replace("\'","'",$_POST["table"])); $main_table="".str_replace("'","",$datafield[0]).""; $main_table=strtolower($main_table); but when i do and echo $datafield[0] or echo $main_table it returns nothing... just blank

« previous php.general (#269883) next »