Results 1 to 2 of 2

Thread: Script to retrieve a page title

  1. #1
    LewisClark is offline Senior Member
    Join Date
    Dec 2009
    Posts
    260
    Rep Power
    3

    Default Script to retrieve a page title

    Hi I am learning PHP programming language. I write one code but When I run this script following error occurs:

    • Apache crashes

    • Apache shows a timeout message

    what’s wrong with it? If you have any in solution please let me know that. Thank you

    This is my script

    Code:
    <html>
    <head>
        <title>Home Page</title>
    </head>
    <body>
    <?php
    $url = "http://localhost/development/php/title/home.php"; 
    
    $source = implode("", file($url));
    
    if(eregi("<title>(.+)</title>", $source, $regs)) {
    
    echo "Title: " . $regs[1];
    
    } else {
    
    echo "Not found";
    
    }
    
    ?>
    </body>
    </html>

  2. #2
    WalkerCook is offline Senior Member
    Join Date
    Dec 2009
    Posts
    253
    Rep Power
    3

    Default

    I've done some changes, please try this code:

    Code:
     = "c:xampphtdocsdevelopmentphptitlehome.php";
    If it is works properly. Please reply me.

Similar Threads

  1. Replies: 0
    Last Post: 03-13-2010, 06:29 AM
  2. Replies: 1
    Last Post: 11-18-2009, 06:29 AM
  3. Page number start page two on page two
    By elzer25 in forum Linux/Free BSD
    Replies: 1
    Last Post: 11-09-2009, 11:12 AM
  4. View the title bar in vista
    By Armando489 in forum Windows Vista
    Replies: 0
    Last Post: 04-21-2009, 07:29 AM
  5. How to put Title in my Web Browser
    By chreshel in forum General Internet Terms
    Replies: 0
    Last Post: 02-02-2009, 09:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48