Re: URL Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Payne wrote:

Hi there everyone,



I have a problem. Basically this is what I need to do:



Request behind the scenes (PHP) an ASP Url on a different website with the
value pid=11111 (Where 11111 is an identifying number).  Then I need PHP to
listen to the response from that request as ASP will then return a value
which PHP has to pickup, and I have ZERO idea how to do this :-(  I tried
something which I though, but that gets the webpage and NOT the url that it
passes back with it’s values.



Any help would be greatly appreciated.



So basically I need to request an URL from within PHP, PHP listens to and
gets the reply URL that is sent back to it with the new value (Which is
determined by the pid= value).



Thank you everyone.



Chris


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.662 / Virus Database: 425 - Release Date: 4/20/2004



You could use PEAR's HTTP_Request and just grab the resulting URL from it.


require_once('HTTP/Request.php');
$req = new HTTP_Request('http://example.com/somescript.asp?pid=11111', array('allowRedirects' => true));
$req->sendRequest();
$url = $req->_url;


That *should* do it.

--
paperCrane <Justin Patrin>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux