Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.