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/02/07 21:10

affiliateian@gmail.com wrote:
> Here is the error with the new codes running:
>
> Warning: implode() [function.implode]: Bad arguments
>
> <?php
> $url=$_SERVER['SCRIPT_URI'];
> $file=explode("/",$url);
> $filename=$file[(count($file)-1)];
> $content = implode('', file($filename));
> preg_match("/<title>(.*)<\/title>/i", $content, $match);
> $title = $match[1];
> $link='removvedbeginningportion/submit?url='.
> $url.'&title='.urlencode($title);
> ?>
> <a href='<?php echo $link;?>'>Link to stumbleupon</a>
>
> Jerry & Toby: Can you explain a little more?
>

It usually means the second parameter isn't an array.

Try adding this before your implode:

echo $filename . "<br>\n";
echo "<pre>\n";
print_r(file($filename));
echo "</pre>\n";

This should print the file name followed by the file. Is the filename
correct, and if so, are you actually able to open (and display) it?



--
==================
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

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