Jump to content

How do I Insert A Var In A URL Function


0207100

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.


[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);
[/code]
Link to comment
https://forums.phpfreaks.com/topic/5533-how-do-i-insert-a-var-in-a-url-function/
Share on other sites

Archived

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

×
×
  • Create New...

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.