This is a public service message to help people when they want to paste a link to the forum (or anywhere) and may be confused or annoyed by all the computer gibberish that's in the link. Sometimes the link breaks when you email it, or part of it turns into a smilie, or it becomes otherwise unusable. These instructions are meant to help you pare down your link to the minimum you need. Enjoy!
I. Anatomy of a URL:
This is the URL of this very page I am typing this post into right now:
Code:
http://www.freethought-forum.com/forum/newthread.php?do=newthread&f=48
http:// is the protocol (hyper-text transfer protocol). You can use other protocols like
ftp:// for file transfer, or
https:// for encrypted web pages (SSL). If you are typing in a credit card number, you want to make sure you see https.
www.freethought-forum.com is the domain name. It refers to a specific computer, or space on a computer. Domain names are unique. A DNS server (domain name service) translates each unique URL to an IP address. DNS actually resolves the url from right to left, starting with the top-level domain (.com, .org, .us, .uk), then the domain (freethought-forum), then the machine on that domain (www).
/forum/newthread.php is the location of a file on the computer that was found in the previous step. It's in a linux format, so the first slash indicates root*, then there's a folder in there called forum, and a file in that folder called newthread.php. The php file extension lets us know that it is a php file, which is just a more powerful way of serving up dynamic content, like forums and blogs. *It's not really the machine's root directory, but the root of all the web stuff.
Here comes the fun part (no really).
?do=newthread&f=48 These are the php parameters. The question mark indicates that we are done with the file name and we are about to get into the parameters. Ampersands are used to separate all other parameters.
So this one has two parameters, do=newthread and f=48. do and f are the names of the variables (programmed by the programmers) and newthread and 48 are the values that were put into those variables.
Programmers like to use plain English (heh) so they know what their code does, and that helps anybody else out who is reading the same code, be it another programmer, or users like us. So if we read straight across, we can guess what is going on. I am making a new thread in forum number 48.
II. Changing the Parameters:
It's fun and valuable to be able to read a url, but it gets even more interesting when you start playing around with editing them.
You've probably noticed that when you search for a post on the forum, and then post a link to the results, the search terms are highlighted in red and bold. Well, suppose I wanted to direct my readers to
this post by godfry, but I wanted to hide the fact that I was searching for NBLs. Easy! The url for the search result is:
Code:
http://www.freethought-forum.com/forum/showthread.php?p=728531&highlight=NBLs#post728531
Do you see where it says
&highlight=NBLs? I just have to delete that part out of the url, and the red bold disappears. (The stuff after the pound sign is redundant and beyond the scope of this primer ... ignore plz).
Google is notorious for adding way too much information to the url. Earlier today I wanted to show some pictures of hipsters, so I did a google image search for hipsters, and here's the link it gave me:
Code:
http://images.google.com/images?hl=en&q=hipsters&btnG=Search+Images&gbv=2&aq=f&oq=
Ugh! What is all that? Do we really need all that? Actually, no. So let's look at it and break it down. We see the protocol, domain, and filename:
http://images.google.com/images and we remember that the parameters begin after the question mark. Looks like we have language equals English, query equals hipsters, blah blah blah who cares about the rest of it. I'll just cut and paste the important parts. Does
http://images.google.com/images?hl=en&q=hipsters work? Yes it does. Can we take it a step further?
http://images.google.com/images?q=hipsters. Still good! Turns out the only required variable is the query term itself.
With regular google (as opposed to images) the link gets even more verbose, and starts to include information about my browser that I might not want to share.
Code:
http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla:en-US:official&hs=oQR&ei=OxRqSpMqhYS2B_bTlLgL&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=stupid+wop+dago&spell=1
Let's see if I can clean that up.
http://www.google.com/search?q=feeding+the+homeless. Ah, that's much nicer.
Notice that it puts plus signs between the words. There are some characters, like spaces, that don't work in URLs. I can address those more next time.
Besides deleting parameters, you can change them. I'll post examples of that in the next lesson. (Be advised that by some definitions, this is considered "hacking", which is fucking laughable. But, yes, it really is that easy to become a hacker. The trick is just not to be afraid of crazy gobbledygook computer language when you see it, and try instead to figure out how much of it you can parse with your natural language skills.)
Finally, don't be afraid to experiment. You're not going to fuck anything up. You can't break the forum from your end (at least not by doing this kind of stuff
). The worst that happens is the page doesn't work right, so you change your changes back and learned another way not to do it.
Good luck and have fun, hackers!