You are here: Re: Pulling Title Tag out of HTML « PHP Programming Language « IT news, forums, messages
Re: Pulling Title Tag out of HTML

Posted by Jerry Stuckle on 03/03/07 02:55

Geoff Berrow wrote:
> 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.'&amp;title='.urlencode($title);
> ?>
> <a href='<?php echo $link;?>'> Link to stumbleupon</a>
>
>
>
>
> Failing that try
> $_SERVER['REQUEST_URI']
> or
> $_SERVER['SCRIPT_NAME']
>

It's available on my (Debian) Linux system with Apache 2.0.sumthun.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация