Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    daed or alive link

    how can i know a link dead or alive ? ( which function do i have to use ?)

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    could do it like this:

    PHP Code:
    if(@fopen("SomeDomain.com""r")){
      
    // active link
    } else {
      
    // dead link

    thats one way of doing it.

  • Users who have thanked angst for this post:

    zodehala (02-16-2008)

  • #3
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    thanks

    we can do like this too

    PHP Code:
    $url "www.codingforums.com";
    $fp = @fsockopen($url,80,$errno$errstr30);
    if (!
    $fp) {
        echo 
    "Error No: $errno <br/> Error : $errstr";
    } else {
        echo 
    $url ." link is ok";
      } 


  •  

    Posting Permissions

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