How do I get the url content of a webpage in PHP

2 replies
I need to access the url address of the page that is being loaded by my PHP script. Does anyone how to do this?

Thanks in advance
#content #php #url #webpage
  • Profile picture of the author wayfarer
    If you're talking about the address currently in the address bar of the browser, you can get it like this:
    PHP Code:
    $current_location $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; 
    This will not include anything after a hash mark (#) in the browser bar, because that information doesn't get sent to the server. It will also not include the current protocol being used (http:// or https://)
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[4425866].message }}
  • Profile picture of the author ADHardwick
    Research "System variables" (for PHP)
    Signature
    Homepage Theme for Wordpress
    Rock Your Adsense Earnings with Custom Google Search Skins!
    {{ DiscussionBoard.errors[4428862].message }}

Trending Topics