I have so stupid issue which I just can't resolve now and I need it so much..
So here's the code:
$siteURL = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/';
$bookmarklet = 'javascript:document.location.href=\'' . $siteURL . '?url=\'+escape(document.location.href)';
it takes things from url, like "domain.com/?url=things"
I need the code to add http:// before "things"
I've tried adding $bookmarklet = 'http://'. $bookmarklete
and changing it in various ways but it didn't helped.
Please help me guys!
It looks like line 72 of your full code is using the query string url from the page url going to the variable $url
$url = $_GET['url'];
try changing to:
$url = 'http://'.$_GET['url'];
Are you trying to change this bit of the code? You question is not very clear on what needs to be changed (what is it now Vs what you want it to be) or where your example url is coming from and where in your $bookmarklet string the 'url' part needs to go... if anywhere?
Your actual $bookmarklet string looks ok to me although as I said before it is not used in the script so you can assign it anything you like and I can't imagine it making any difference!
You could tidy the $bookmark string to this:
$bookmarklet = "javascript:location.href='$siteURL?url='+encodeURI(location.href)";
encodeURI()
is the newer replacement for escape()