Member
Member
Ipstenu   2009-10-18, 22:37
#1

This is weird, I know.

I want to make a 'tweet this!' link on the pages, and to do that, I need to be able to self-reference the URL.

Tweet This

Obviously I want to replace URLGOESHERE with ... the URL ;) So How can I extract THIS page's URL? That is if I have it on an album page, I want it to show the album URL, etc etc.

Member
Member
kagutsuchi   2009-10-18, 23:32
#2

You should be able to do this simply through PHP using $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI'].

Administrator
Member
Member
Ipstenu   2009-10-19, 17:55
#4

I suspected there was a function for it, and I think my brain just glazed over at a certain point trying to find it (search only works when you know WHAT you're looking for, y'know ;) ). Also remembering that some times you need an echo.


`

[url=http://twitter.com/home?status=Looking%20At:%20

%20http://my.domain.com/
]Tweet
This
`
and for image.php

`

[url=http://twitter.com/home?status=Looking%20At:%20

%20http://my.domain.com/
]Tweet
This
`
Muchas Gracias!

Administrator
Administrator
acrylian   2009-10-19, 17:59
#5

Yes, that is why we try hard to name our functions "speaking". Also basically every "get" function has a "print" equivalent.

Member
Member
Ipstenu   2009-10-19, 18:00
#6

And that's why I've been recommending y'all to everyone who wants a gallery on their website right now! Well coded and helpful!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.