Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to only get title information from a website
Hi!

I'd need to extract the information inbetween the <title></title> Tags
of quite a lot of webpages. Currently I'm fetching the pages with curl
and extract the titles with preg_match.

That's quite nice, and it's working, but on the other hand much more
data is transfered (the whole body of the webpages) than needed.

Can anyone of you give me a hint if and how it's possible to just
request the header of a webpage? I'm fine with a RTFM if you can point
me to the FM I should R.

Thanks in advance for your help,

Andreas

Report this thread to moderator Post Follow-up to this message
Old Post
Andreas Stallmann
03-01-08 12:01 AM


Re: How to only get title information from a website
Andreas Stallmann wrote:
> Hi!
>
> I'd need to extract the information inbetween the <title></title> Tags
> of quite a lot of webpages. Currently I'm fetching the pages with curl
> and extract the titles with preg_match.
>
> That's quite nice, and it's working, but on the other hand much more
> data is transfered (the whole body of the webpages) than needed.
>
> Can anyone of you give me a hint if and how it's possible to just
> request the header of a webpage? I'm fine with a RTFM if you can point
> me to the FM I should R.
>
> Thanks in advance for your help,
>
> Andreas

check into fopen() and fread() on www.php.net

--
Norman
Registered Linux user #461062

Report this thread to moderator Post Follow-up to this message
Old Post
Norman Peelman
03-01-08 12:01 AM


Re: How to only get title information from a website
On 29 f=E9v, 17:39, Andreas Stallmann <andreas.stallm...@web.de> wrote:
> Hi!
>
> I'd need to extract the information inbetween the <title></title> Tags
> of quite a lot of webpages. Currently I'm fetching the pages with curl
> and extract the titles with preg_match.
>
> That's quite nice, and it's working, but on the other hand much more
> data is transfered (the whole body of the webpages) than needed.
>
> Can anyone of you give me a hint if and how it's possible to just
> request the header of a webpage? I'm fine with a RTFM if you can point
> me to the FM I should R.
>
> Thanks in advance for your help,
>
> Andreas

Hi Andrea,

Norman answered you fine.

Maybe this also helps:

<?php
// get contents of a url into a string
$filename =3D "http://www.someurl.com";

$handle =3D fopen($filename, "r");

$contents =3D '';
while (!feof($handle)) {
$contents .=3D fread($handle, 8192);
}

fclose($handle);

print "Content of " . $filename . ":<p>" . $contents;
?>

Regards

Luisa

Report this thread to moderator Post Follow-up to this message
Old Post
vrlist.info
03-02-08 01:03 PM


Re: How to only get title information from a website
Hi Luisa,

thank's for your help. That...

vrlist.info schrieb:
> $handle = fopen($filename, "r");
...did the job.

TNX,

A.

Report this thread to moderator Post Follow-up to this message
Old Post
Andreas Stallmann
03-03-08 12:00 AM



[url=http://www.BestGBlog.com/Watch?movie=726071]Lindsay Lohan and Alyson Han
nigan Lick Pussies On Sofa![/url]

Report this thread to moderator Post Follow-up to this message
Old Post
Aderedtard1
03-23-08 05:11 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:09 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.