Jump to content
Old threads will finally start getting archived Γ—
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 Γ—

Recommended Posts

I'm fried, my head hurts, and I should sleep.. but I wanna do this one thing before I forget to something im working on..

Β 

I just want to get the www.domain.com from the domain the script is hosted on and echo it out.. I just can't think of the proper way to do it, well can't seem to recall the proper function name rather. I know one exists, but can't just google it without getting 100000000000000000000 results in the effect to something thats not relative to what I want.

Β 

Someone wanna help out this burnt out bum..Β  ;)

Link to comment
https://forums.phpfreaks.com/topic/97654-something-simple/
Share on other sites

You just want to get the contents of a remote webpage? Any file handling function will do:

Β 

$contents = file_get_contents("http://www.domain.com");

Β 

Note...this will give you the generated contents, not the PHP code that generated it.

Link to comment
https://forums.phpfreaks.com/topic/97654-something-simple/#findComment-499668
Share on other sites

tippy thats it.. funny thing to, thought I was doing it wrong.. cause i was just trying to echo it out as a simple link.. and couldnt get it to echo right.. kept putting the domain/folder/the the domain again.. This should tell you how much sleep it is i need, I forgot to add the http:// part to echo as well, so the browser took the request and thought I was tryin to do something dynamic with it rather then just make a simple link.. damn im good! putting the http part in the link tag made it work.. I think im goin to sleep.. who knows, maybe time for coffee.. bah.. thanks you guys for the responces

Link to comment
https://forums.phpfreaks.com/topic/97654-something-simple/#findComment-499731
Share on other sites

Not that I can add anything helpful, but I do understand how it feels to be wired all night and then stuck on a stupid little thing that should be so simple. Sometimes I look at my code the following morning and wonder what the hell I was thinking. Hehehe!

Link to comment
https://forums.phpfreaks.com/topic/97654-something-simple/#findComment-499751
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.