Jump to content

[SOLVED] self url inside an image/


Michdd

Recommended Posts

I found this function which gets the current URL.

 

function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? ''
	: ($_SERVER["HTTPS"] == "on") ? "s"
	: "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? ""
	: (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}

 

I'm wondering if this will work inside an image script on a page? Or will it just return the URL of where the file is hosted?

 

And if so, is it possible to get the URL of the page where the image is embedded?

Link to comment
https://forums.phpfreaks.com/topic/172432-solved-self-url-inside-an-image/
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.