www.webdeveloper.com
Page 3 of 3 FirstFirst 123
Results 31 to 41 of 41

Thread: Link checker

  1. #31
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Well, I don't know ASP and I don't want to learn it yet.. It's too hard! lol I don't know why Microsoft makes everything in caps and stuff... Also, Brinkster doesn't have much bandwidth at all--something that I need.

    There is also http://freewebs.com/ which offers no ads, PHP support, and is free...
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

  2. #32
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    Freewebs also have CGI, so you could use them for your link checker. What do you want to check the links of, by the way?

  3. #33
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    I basically just want to learn all of the practical (or impractical, lol) uses of PHP. I want to learn all that "extra" stuff that no one bothers with. I want to just learn all I can! I don't have a book or anything to learn from... All I have is http://php.net/ a useful resource, but not a tutorial area.

    Programming and HTML have their advantages, HTML is easy to learn yet you have to have valid HTML; in programming there is no "valid" or "invalid" unless it's a syntax error or something... Which is its advantage over HTML. Programming is also more powerful (duh, how do you think they came up with HTML? lol).

    BTW, don't say to go to Webmonkey.lycos.com or whatever it is for PHP tutorials because none of the ones there are any good... At least, not to me.
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

  4. #34
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    HTML is easy to learn
    I suppose it depends on how you code - I found programming fairly easy to pick up, but learning to hard-code HTML took longer. HTML does have editors though, which makes it a lot easier.

    Of course, you then get on to whether a RAD tool like Delphi or another IDE is an editor, and to "hard-code" you should be doing everything manually.

    Good luck with learning PHP - it's a great language. I'm gradually learning, and I agree with you - the best resources is the website.

    Adam

    P.S. A good way I found to learn was (i) to make something I enjoy (internet games), and (ii) set up a webserver on my computer so I can test much more easily.
    "If you’re not using valid HTML, then you haven’t created a Web page. You may have created something else, but it isn’t a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History

  5. #35
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Adam, that's exactly what I do. I just don't enjoy making games, I enjoy making more complex things... I satisfy myself more often when I accomplish something and don't get frustrated. lol

    Also, I have the http://aprelium.com/ Web server installed on my system so I can run PHP (and I can also download CGI) scripts on my local machine. The one thing is I can't CHMOD folders...
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

  6. #36
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    Thanks for the link to the server - it's the only one I've seen that I can run. Now I can test PHP more easily. I was running a link through my server - they aren't exactly miles from one another...

  7. #37
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    No problem.
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

  8. #38
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    I think this is what you are looking for, Jona:

    PHP Code:
    <html>
    <head>
    <title>Link Validator</title>
    <style type="text/css">
    a {
        color:darkblue;
    }
    </style>

    </head>
    <body>

    Input a full url (ie. http://www.infinitypages.com/index.php).

    <form action="checklinks.php" method="post">
    <input type="text" name="url" size="50">
    <input type="submit" name="submit" value="Check links">
    </form>

    <?php

    #######################################################
    # This script is Copyright 2003, Infinity Web Design  #
    # Written by Ryan Brill - ryan@infinitypages.com      #
    # All Rights Reserved - Do not remove this notice     #
    #######################################################

    if ($_POST["url"]) {
        
        
    $file $_POST["url"];
        
        echo 
    "Links in file <a href=\"$file\">$file</a>:<br/><br/>\n";
        
        
    $x 1;
        
    $valid 0;
        
    $invalid 0;
        
        
    $filename split("/",$file);
        
    $filename $filename[count($filename)-1];
        
    $path split($filename$file);
        
    $path $path[0];
        
        
    $contents = @file($file) or die ("Failed to open <a href=\"$file\">$file</a> to check links. Please be sure it is an absolute URL.");
        
        foreach (
    $contents as $line_num => $line) {
            if (
    preg_match('/\<a href=.*?\>/'$line$a)) {
                for (
    $i 0$i count($a); $i++) {
                    
    $url preg_split("/href=['\"]/"$a[$i]);
                    
    $url2 preg_split("/['\"]/"$url[1]);
                    
    $spliturl parse_url($url2[0]);
        
                    if (
    $spliturl[scheme] == "") {
                        
    $finalurl $path.$url2[0]; 
                    }
                    else {
                        
    $finalurl $url2[0];
                    }
                    
                    if (
    strtolower($spliturl[scheme]) != "mailto") {
                        
    $code = @file ($finalurl);// file to open
                        
    if (!$code) {
                            echo 
    "<span style=\"color:darkred;\">Invalid:</span> <a href=\"$finalurl\">$finalurl</a><br/>\n";
                            
    $invalid++;
                        }
                        else {                    
                            echo 
    "<span style=\"color:green;\">Valid:</span> <a href=\"$finalurl\">$finalurl</a><br/>\n";
                            
    $valid++;
                        }
                    }
                }
            }
        }
    }

    if (
    $x == 1) {
        echo 
    "<br/>\n";
        echo 
    $valid+$invalid." links checked.<br/>\n";
        if (
    $valid 0) {
            echo 
    "<span style=\"color:green;\">$valid valid links found.</span><br/>\n";    }
        if (
    $invalid 0) {
            echo 
    "<span style=\"color:darkred;\">$invalid invalid links found.</span><br/>\n";
        }
    }
    ?>

    </body>
    </html>

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  9. #39
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    Woah...

  10. #40
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Like it?

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  11. #41
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Yup, Cijori, Pyro knows his stuff and he knows it well!
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles