|
Posted by Geoff Berrow on 03/02/07 11:26
Message-ID: <1172825628.217900.22210@p10g2000cwp.googlegroups.com> from
affiliateian@gmail.com contained the following:
><?php
>$text = file_get_contents($url);
>preg_match('<title>(.*)</title>', $text, $matches);
>$title = $matches[1];
>?>
>
>How does one take the above and insert the variables into this URL?
>
>http://www.stumbleupon.com/submit?url=http://www.yoursite.com/article.php&title=The+Article+Title
>
>Thanks for your patience.
<?php
$filename=__FILE__;
$content = implode('', file($filename));
preg_match("/<title>(.*)<\/title>/i", $content, $match);
$title = $match[1];
$link='http://www.stumbleupon.com/submit?url='.$_SERVER['SCRIPT_URI'].'&title='.urlencode($title);
?>
<a href='<?php echo $link;?>'> Link to stumbleupon</a>
--
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/
[Back to original message]
|