Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Great Mirror Code -- Not question, just sharing

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    ...this will reach 11. It's just a count.
    Yes, you're right. I apologize, I was confusing $n with $check.
    btw, I've used the file commands before, so I'm assuming that allow_url_fopen is working... so.... yeah.
    But you decided to post it for others to use. You should always assume they have the minimal requirements when making a script public; that means no short tags, and no relying on config options that aren't always on by default.
    I'm kinda lost in the last paragraph. From what I've seen, md5 doesn't just do those characters, but all letters, plus caps. I might be imagining this, though, in which case, yeah, you're right...
    You are. md5() returns a hexadecimal string, meaning it contains only digits from 0 to F.
    Your code didn't really make sense to me 'cause a lot of it was complex commands I'm unfamiliar with...
    What "complex commands?" The only thing you could possibly have had trouble with was fsockopen(). The rest is just simple looping and string manipulation.
    Also... the only reason mine is too complex is that it does the loop to move to the next one if it's an error..... I don't really need that. Heh.
    So if one of your mirrors is down, all the people who would normally be sent to that mirror can't download your file?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #12
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Yes, you're right. I apologize, I was confusing $n with $check.
    Yeah, no problem. I added that afterwords when I realized it wouldn't get there

    But you decided to post it for others to use. You should always assume they have the minimal requirements when making a script public; that means no short tags, and no relying on config options that aren't always on by default.
    Good point. I'm using this for my own stuff and sharing it as a "cool idea" more than a script to just use, but you're right to point that out... I was thinking of it for me, not for those without that command.

    You are. md5() returns a hexadecimal string, meaning it contains only digits from 0 to F.
    Ah, ok. Hmm... true, then.

    Your code-- I don't know much about ports, fsockopen, and things like that. It's not the syntax as much as the stuff behind it. This is all fairly new to me... trying to catch up.

    So if one of your mirrors is down, all the people who would normally be sent to that mirror can't download your file?
    Yeah... they would get a dead mirror.... so... it's true, I should code that in there. I just think I'd know which servers were up, at least in the case I'm gonna be using this code for now. But... that's a useful thing if you aren't keeping an eye on the servers.
    Also, an easy alt is just to have it check, then, if it doesn't work, just revert back to a mirror that will definitely be up (maybe the host that the page itself is on). But... probly worth coding the rest.

  3. #13
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't know much about ports, fsockopen, and things like that.
    Google for a TCP/IP tutorial.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #14
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm not just talking about PHP with them, but the stuff in general. Anything specific I should look for? I mean, a php tut will just tell me what to type, not why.

  5. #15
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Nor was I
    http://compnetworking.about.com/od/tcpip/l/blfaq012.htm

    There are several ports that are usually used for certain services: 80 for HTTP, 21 for FTP, 23 for telnet, 22 for SSH...
    These aren't binding; it's only a convention. Thus we get URLs like http://www.example.com:8080/index.php telling the browser to connect to port 8080, not the default 80. A fairly comprehensive list of these services, with explanations, can be found in any *n?x computer's /etc/services file.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #16
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    A fairly comprehensive list of these services, with explanations, can be found in any *n?x computer's /etc/services file.
    Or you could look at the comprehensive list of registered ports at the IANA website.

    Mike

  7. #17
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Oh, that's where it got to. Knew it was there somewhere.

    It's not as nicely-laid-out as the /etc/services file.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •