Jump to content


This topic is now archived and is closed to further replies.


How do I Insert A Var In A URL Function

Recommended Posts

I need to insert 2 variables into a url that is part of a function and can't seem to do it. I know the code below has an error in it and am thinking I need to make $_SERVER[REMOTE_ADDR] and http://" . $_SERVER[SERVER_NAME] . $_SERVER[REQUEST_URI]; some sort of a var but am clueless how to do it.

Any help will be greatly appreciated.

The following code is a snip of the code.


return $children;
$url = "http://domain.com/xml_feed.php?p_id=1002&ad_count=5&channel=1&doc_offset=0&keyword=entertainment&limited=0&uip=$_SERVER[REMOTE_ADDR]&referring_page=$page_url ="http://" . $_SERVER[SERVER_NAME] . $_SERVER[REQUEST_URI];"; //URL of the XML FEED

$contents = file_get_contents($url);

$data = GetXMLTree ($contents);

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.