Re: Question about Request.php

From: Date: Thu, 01 Dec 2005 20:18:50 +0000
Subject: Re: Question about Request.php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-226728@lists.php.net to get a copy of this message
do a: print_r($_REQUEST) on the php page. if nothing, things aren't configured correctly or you aren't passing in variables correctly. On Dec 1, 2005, at 12:15 PM, Danilo Azevedo wrote:
Hi, my name is Danilo, i am from Brazil I need your assistence with a code made by your self, if you are not too busy :P I am using PHP/XML with your request.php file, but i cant get some attributes from a Tag, everything is working fine, but it :( The Tag name is "RUA" and have some attributes that i need for my application, i am adding all Tags and if i do a echo $Response i cant see any attributes. If you cant help please tell me where can i find some support!! please!! :) Thanks for all and sorry for my badly english :D Danilo ---------------------------------------------------------- my request code: ... $Response = ''; $Req = &new HTTP_Request(" http://www.geoportal.com.br/mapapp/avl/xservmapa1.asp")<http://www.geoportal.com.br/mapapp/avl/xservmapa1.asp%22%29> ; $Req->setMethod(HTTP_REQUEST_METHOD_POST); $Req->clearPostData(); $Req->addHeader("Ticket",$HTTP_SESSION_VARS["ticket"]); $Req->addPostData('CX', $LongC); $Req->addPostData('CY', $LatC); $Req->addPostData('Z', $LargM); $Req->addPostData('N', 1); $Req->addPostData('P1', "MAX"); $Req->addPostData('X1', $Long); $Req->addPostData('Y1', $Lat); $Req->addPostData('RT1',$Texto); $Req->addPostData('E1', "SXCAR1-32;D30"); $Req->addPostData('H', $Alt); $Req->addPostData('W', $Larg); $Req->addPostData('RINFO', 100); $Req->addPostData('INFO', "S"); if (empty($Zoom)){
       if (!empty($LongI) || !empty($LatI)){
               $Req->addPostData('XP',$LongI);
               $Req->addPostData('YP',$LatI);
               switch ($TCentr){
                   case 1:
                                       $Req->addPostData('CMD',"C");  break;
                   case 2:
                                       $Req->addPostData('CMD',"C+"); break;
                               case 3:
                                       $Req->addPostData('CMD',"C-"); break;
                   default:
                                       $Req->addPostData('CMD',"C");  break;
               }
       }
}else{
       $Req->addPostData('XP',round($Larg / 2));
       $Req->addPostData('YP',round($Alt / 2));
       if ($Zoom == 1)
               $Req->addPostData('CMD',"C+");
       elseif ($Zoom == -1)
               $Req->addPostData('CMD',"C-");
} $Req->sendRequest(); $Response = $Req->getResponseBody(); ... ---------------------------------------------- echo $Response dont show the attributes (NroIni, NroFim, Bairro) :( here is how the server send a correct XML request, look at the RUA tag: <?xml version="1.0" encoding="windows-1252" ?> <SERVMAPA>
       <LOCALIDADE>  // dados sobre a localização do CENTRO DO MAPA
               <CIDADE>nome da cidade</CIDADE>
               <ESTADO>sigla do estado</ESTADO>
       </LOCALIDADE>
       <MAPA>
               <PIC>url do GIF gerado</PIC>
               <CX>longitude do centro do mapa</CX>
               <CY>latitude do centro do mapa</CY>
               <Z>zoom</Z>
               <N>quantidade de pontos</N>
               <PONTO indice="">  // Haverão N itens do tipo PONTO
                       <P>identificação do ponto</P>
                       <X>longitude</X>
                       <Y>latitude</Y>
                       <XP>posição do ponto sobre o GIF. Coordenada em
pixels</XP>
                       <YP>posição do ponto sobre o GIF. Coordenada em
pixels</YP>
                       <LOCALIDADE>  // dados sobre a localização do PONTO
                               <RUA NroIni="" NroFim="" Bairro="">nome da
cidade</RUA>
                               <CIDADE>nome da cidade</CIDADE>
                               <ESTADO>sigla do estado</ESTADO>
                       </LOCALIDADE>
               </PONTO>
       </MAPA>
</SERVMAPA>


« previous php.general (#226728) next »