Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parsing URL contents into a variable using PHP

Status
Not open for further replies.

dbrb2

Instructor
Jul 19, 2004
121
GB
Hi - I have a php script on server A into which I can pass paramters via the URL. This script produces HTML which is then displayed in the users browser.

Server B has a page that want to make use of some of the info within this HTML.

My first solution was to use javascript and ajax. I issued an ajax request to the script on server A, including the parameters I wanted. The call responded with the HTML placed into a javascript variable on server B, which I could then parse to extract the info I wanted. This worked absolytely fine, however, this required running server side javascript.

I was wondering if there was any way to do this exclusively in PHP. I played around with output buffering, but couldn't find a solution that let me pass in the URL and to capture the output to a variable.

Any thoughts?

Cheers,

Ben
 
sure. why can't the clientside ajax also send a request to a php script on server B? (you'd need to call a script from server b in the (x)html, of course); to get around cross-server limitations.
or why can't server a automatically call a web service on server b, scripted in php? this would be as simple as an fopen() call.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top