« Previous Next »

Thread: Websites content reading code like title of any website.

Last post 01-24-2008 8:07 PM by wwwXpert. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 01-21-2008, 6:57 AM

    • aliggl
    • Not Ranked
    • Joined on 01-21-2008, 11:51 AM
    • http://www.GlobalGuideLine.com
    • Posts 3

    Websites content reading code like title of any website.

    Hi all here at IIS forum i want to develop websites content reading code like title of any website or meta and other tags, i want to give URL to this code at run time and it will detect its meta, title or other information and return to me in variables how to do and which language will be use for it like JavaScript, PHP, ASP, ASP.NET or JSP etc.
    Please guide me with helpful links or sources.
    Thanks.
    Ali.

    webmaster http://www.GlobalGuideLine.com
  • 01-21-2008, 11:20 AM In reply to

    Re: Websites content reading code like title of any website.

    You asked in a PHP forum, so don't expect answers for any other than PHP.  Beyond that, do you want to retrieve the HTML but not display it?  As in if you viewed the source?  Or are you just looking for meta and header information?

    Jeff

    Look for Wrox's new book Professional IIS 7 in your local bookstore, or order now at Amazon.com
  • 01-22-2008, 12:27 AM In reply to

    • aliggl
    • Not Ranked
    • Joined on 01-21-2008, 11:51 AM
    • http://www.GlobalGuideLine.com
    • Posts 3

    Re: Websites content reading code like title of any website.

    Yes Jeff just looking for meta and header information using PHP how to do it please guide me. thanks.

    Ali. 

    webmaster http://www.GlobalGuideLine.com
  • 01-24-2008, 8:07 PM In reply to

    • wwwXpert
    • Not Ranked
    • Joined on 01-24-2008, 7:38 PM
    • Posts 4

    Re: Websites content reading code like title of any website.

    Use PHP curl.

    PHP doesn't come with curl by default so you need to enable the php_curl extension in your php.ini file.

    If you're running IIS, you'll also need to copy the libeay32.dll and ssleay32.dll libraries to the C:\Windows\System32 folder (these dll's are included with the php package that you extract)

    http://us3.php.net/manual/en/function.curl-setopt.php

    Here's a quick example... this will provide you with the header info for google.com

    <?php

    // create a new cURL resource
    $ch = curl_init();

    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "http://www.goole.com/");
    curl_setopt($ch, CURLOPT_HEADER, 1);

    // grab URL and pass it to the browser
    curl_exec($ch);

    // close cURL resource, and free up system resources
    curl_close($ch);

    ?>

     

     

     
    
Page 1 of 1 (4 items)
Microsoft Communities