-
How to retrieve file
Hello!
i tried to retrieve a file...it all was okay but i failed to get the 3 things out of the file...
"some text" between the <title>some text</title tags.
the description of the meta description tag etc. can anyone help me get this information ?
thanks!
-
That's really vague. How are you "retrieving" the file?
-
hi!
I am using fopen thing...!
Thanks!
-
I'm still not following your problem. What is the exact code you're using and what's an example of the input?
Is it getting all data except the title and meta tags?
-
Hi!
I am getting the full source of th4e webpage...here i am using this particular code to retrieve the source code of the webpage.
PHP Code:
<?php
$handle = fopen("http://www.example.com/", "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
?>
Hope this helps!
-
hmm
I just tested your php code on my website
and it loads all of the source perfectly
perhaps you need to check and see if there are meta tags at the file you are trying to load?
or are you asking how to aquire that info out of the file you loaded?
-
Hi!
Yes i know that code works...and also the meta tags are also there...i am just unable to seperate them from rest of the code retrieved. Any help would be appericiated.
Thanks!