|
Posted by Geoff Berrow on 03/03/07 02:49
Message-ID: <olmhu2ln294ghk1e8pkatqo60e8j2caevh@4ax.com> from Geoff
Berrow contained the following:
>
>>Any ideas?
>
><shrug>It works on my machine
Scratch that, it doesn't.
The variable $_SERVER['SCRIPT_URI'] was not available .
Try this
<?php
$url=$_SERVER['SCRIPT_FILENAME'];
$file=explode("/",$url);
$filename=$file[(count($file)-1)];
$content = implode('', file($filename));
preg_match("/<title>(.*)<\/title>/i", $content, $match);
$title = $match[1];
$link='http://www.stumbleupon.com/submit?url='.$url.'&title='.urlencode($title);
?>
<a href='<?php echo $link;?>'> Link to stumbleupon</a>
Failing that try
$_SERVER['REQUEST_URI']
or
$_SERVER['SCRIPT_NAME']
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Navigation:
[Reply to this message]
|