Re: PHP: Ajax send()

From: Date: Fri, 22 Feb 2008 16:41:03 +0000
Subject: Re: PHP: Ajax send()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-269885@lists.php.net to get a copy of this message
2008. 02. 22, péntek keltezéssel 12.03-kor germana ezt írta: > 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 > and if you var_dump($_POST) what does it show? greets Zoltán Németh >

« previous php.general (#269885) next »