Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    linkValidator 0.3

    Download button

    No screenshots available
    Downloads: 375  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.1/5)
    10 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Daantje Eeltink | More programs
    GPL / FREE
    May 8th, 2008, 13:57 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    linkValidator description

    linkValidator is a PHP class that can validate a URL.

    linkValidator is a PHP class that can validate a URL. It can return true or false, and it is able to return a full error message.

    Here are some key features of "linkValidator":

    · Follows redirection headers when status is an 300, 301, 302 till 399.
    · Checks with the HTTP/1.0 and/or HTTP/1.1. protocol.
    · Doesn't use any system or command line tools.
    · Easy to implement.
    · PHP4 and PHP5 compatible.

    Examples

    //EXAMPLE CODE 1
    //check one URL
    $linkValidator = new linkValidator('http://www.daantje.nl/');

    echo $linkValidator->message();
    echo "< hr >";
    echo $linkValidator->status();
    echo "< br >".($linkValidator->status() ? "worked" : "failed");

    //EXAMPLE CODE 2
    //check multiple URL's
    $linkValidator = new linkValidator();

    $checkThese = array(
    "http://www.rokenmoetmogen.nl/",
    "http://www.daantje.nl/",
    "http://www.daantje.nl/",
    "http://www.daantje.nl/blah.html",
    "http://www.google.nl/"
    );

    foreach($checkThese as $url){
    $linkValidator->linkValidator($url);
    echo "$url< br >";
    echo $linkValidator->message();
    echo ($linkValidator->status() ? " - worked" : " - failed") ."< br >";
    echo "< hr >";
    flush();
    }

    //EXAMPLE CODE 3
    //do it all manualy
    $linkValidator = new linkValidator();

    //disable redirects... Show when it's a status 30x
    $linkValidator->follow_redirects(FALSE);

    $array = $linkValidator->disectURL('http://www.daantje.nl/index.php');
    $linkValidator->open($array['host'],$array['port'],$array['get'],'http://www.daantje.nl/','http://www.whole.world/fake/referer.html');
    echo $linkValidator->message();
    echo ($linkValidator->status() ? " - worked" : " - failed") ."< br >";

    //EXAMPLE CODE 4
    //check if it's allowd from this file as referer...
    $linkValidator = new linkValidator('http://www.daantje.nl/index.php',$_SERVER['REQUEST_URI']);

    echo $linkValidator->message();
    echo "< hr >";
    echo $linkValidator->status();
    echo "< br >".($linkValidator->status() ? "worked" : "failed");

    What's New in This Release:

    · The class follows redirects when status is between 300 and 399Default this option is set TRUE!! This can be disabled as shown in example 4 in this file, with the follow_redirects(). Thanx to Felix Nagel for the feature request.
    · Also tested and works on PHP4 and PHP5.
    · Fixed PHP warnings.



    Product's homepage

      


    TAGS:

    PHP class | link validator | URL validator | URL | validator | PHP



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM