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 affiliateian on 03/03/07 02:14

> I'm trying to help, but without the information I'm asking for, you make
> it almost impossible to give you a good answer.

Hey Jerry,

First of all, know that your help is really appreciated. Being a
newbie at coding, I am still trying to follow the lingo. Sorry about
missing some info. Let me try it here.

Running this:

<?php
$url=$_SERVER['SCRIPT_URI'];
$file=explode("/",$url);
$filename=$file[(count($file)-1)];
echo $filename . "<br>\n";
echo "<pre>\n";
print_r(file($filename));
echo "</pre>\n";
//$content = implode('', file($filename));
preg_match("/<title>(.*)<\/title>/i", $content, $match);
$title = $match[1];
$link='edited-so-url-displays://www.stumbleupon.com/submit?url='.
$url.'&title='.urlencode($title);
?>
<a href='<?php echo $link;?>'>Link to stumbleupon</a>

Resulting HTML is:

<a href='http://www.stumbleupon.com/submit?url=&title='>Link to
stumbleupon</a>

Want to get this:

<a href='http://www.stumbleupon.com/submit?url=http://www.mydomain.com/
file.html&title=Title of file.html'>Link to stumbleupon</a>

How was that?

 

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

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