I'm not even ready to talk about clicking and such...how does this webpage stuff work? In English!

     Ok, I can do this, but it's going to take a while. The internet started out as a way for some universities to link their computer systems. At first it was sort of a "let's see if we can do this" kind of thing, but soon they realized that they were on to a method of communications. E-mail followed soon after, and eventually the other professors started asking the computer professors if this new type of connection could transfer other types of data. Professors are always doing research, and one person's research is usually an extension of another's, so a way to display results would be nice. And so HTML was born.

     Ahhh! I don't like complicated abbreviations!

     Well, you're going to love this one then; it's very simple...which brings up rule #1 for scientists, mathematicians and all sorts of smart people, including computer types:

    If you give a simple thing a complicated name, you'll seem smarter.

     Ok, back to HTML. It stands for "hyper-text markup language", and it's pretty simple. Let's start with the word "text"; that's pretty straightforward. You know, letters, numbers and symbols like # and $ and a whole bunch more. But what's hypertext? It's just text and more...audio files, pictures, videos...all the other things you can put on a web page. Not too bad so far...what about "markup"? Imagine if you gave a book to a printer to be printed. The printer would take the book, and ask you a whole lot of questions...where do you want the page numbers? How big should the margins be? All the things he needs to know to go from "a bunch of words" to "a finished book". While you're telling him your specifications, he'd pull out a pencil and start marking up the pages, making notes about the things you're telling him. Well, when you make a web page you need to specify all the same sorts of things. So the language you use to make it has to have those things...it has to be a "markup language". There, that wasn't so bad, was it? All that's left is to get it to your computer, and for that we have to go beyond a language. We have to specify things like timeouts (how long to wait) and such, so we need a protocol. When you view a web page you'll notice that (most of the time) the address starts with "http". That's "hyper-text transfer protocol", a way to move hyper-text documents around.

     So, that's all there is to a web page? Well, not quite. When you make an html web page, there's one bad thing...it never changes. Or, to be more accurate, it doesn't change until somebody goes and changes it. Now, if you were a scientist giving results to an experiment that would be fine...the results don't really change much (you might come back in 6 months and do an update, but that's about it). But that would leave us here at Doug's Dirt Diary in a bind; we need to update this site all the time. And it would be impossible to fire up the programs to make a web page, alter the page and put them away as often as we would need to. And imagine how many pages there would have to be...we'd need separate pages for each set of pictures, and different ones to display different numbers of pictures at once. What we need is a language that can "do things". But how is that possible?

     Ok, now I have to teach you about the server-client relationship among computers. This is another one that sounds complicated, but I can make it really clear with one line: The server makes something available, and the client uses it. That's it; stated another way, a server is sharing resources, and a client is using them. When you view this page, you make a request to a computer in California (where our host is located), and that computer is the server, sending you all the pieces you (r computer) needs to put this page together. At home I have a computer with a printer that's shared over my home network. When one computer prints to it, the one sending the document to be printed is the client, and the one doing the printing is the server (in this case a print server).

     So now that we're all experts on client-server relationships, we can re-state our problem...we need a server-side language. And not just any old language; we need a scripting language.

     What's scripting?

    A script is just like a program, except it can't do as much. The smart people who think up such things realized early on that you didn't really want to let people who wrote a web page (who you may have never met) run a program on your computer. They could do all sorts of bad things, because running a program gives you "security clearance" on the computer you run it on. Believe me, you don't want to give just anybody that much permission. So a more limited sort of programming was developed, called scripting (there's more to the difference between scripts and programs than that, but that's all we need to know for now). And since the script is being run on the server, there is no risk to your security. The server runs the script, assembles the page, and sends it.

     Assembles the page?

    Yep; when you come here and request a page, that page doesn't really exist. The server runs the script, arranges the results so it looks just like any other web page, and then sends it. The whole process is invisible from the user's standpoint, and takes a few thousandths of a second. And you get the latest-greatest page we can offer. The scripting language we use is called "PHP". PHP stand for "PHP hypertext preprocessor", and it doesn't make sense to me either...how can the first letter of PHP stand for PHP? Well, somewhere there's a programmer who thinks it's funny! So the next question is: If the things I see on your pages aren't written right into the web pages, where are they?

      Oh, now you've done it. Now I have to explain SQL. Ok, I'm being dramatic; once again, this is a simple idea with a complicated name. What we need is a way to store information, but in a way that gives us two benefits:

    The kind of program that does both of these things really well is called a "database" (although a lot of people refer to a database like it was an encyclopedia, it's really more). Some databases are incredibly complicated and expensive, but for our purposes the most common free one is plenty. It's called "mySQL", and the SQL part is what's important. SQL stands for "structured query language". It's sort of a deal with the programmers...if we agree to keep our searches (or queries) in a specific form, SQL will give us search results very quickly. It's hard to picture without an example:

     You click on the "Newest Pictures" page. The request is handled by PHP, and when it gets to the part where it needs to use the database, it makes an SQL query (What are the names of all the pictures in the database, arranged from newest to oldest?) That information goes back to PHP, which formats it...only shows you a certain number, puts a nice border around it...whatever. Then it gets sent to you, where you decide if you want to ask for a different page, and it all happens again. You will always get the newest set of pictures we have at the moment you make the request.

     Bet you never read a paragraph like that and expected to understand it, did you?

     You can think of SQL as a file cabinet with drawers that  open both ways. You request pages and files on one side of the cabinet, while on the other side we're putting in the information to make the newest pictures, audio and video files available. Invisibly, seamlessly and at any time, and without having to re-write the page each time. Pretty clever stuff!

     So that allows me to write pages that "do" things on the server. Is that all I need? Well, yes and no. I could write a whole site that uses the technology I've described, but that leads to a small problem. What about those times when I want to give you (or you ask for) a small amount of information, or for something that's outside of our site. It would be nice if I could make the page open a new window...you could check out whatever is on that remote site, or read the snip of information we provide, and then close the new window and be back where you were. But there's nothing I can send from the server to open a new window (if there was, all kinds of servers would be opening all kinds of windows on your computer all the time; not a good situation). What is needed is a client-side scripting language. But  that's more of a security concern; I mean, do whatever you want on the server, but I don't want you doing things on my computer!

     The most common client-side scripting language is Javascript (not to be confused with the programming language "Java"; they're completely different!) Originally, javascript had some problems with things like permissions, and it got a bad name because people were using it to do some bad things. But the newer versions of javascript have mostly eliminated these problems...for example, javascript can't "do" anything to a window it didn't open, and most modern browsers (the program you use to look at a web page) don't let javascript open a window unless you click on something. It's not 100%, but it's not as bad as the old days, when visiting a site sometimes led to a forest of popups. I've used popup windows on this site; for the "Where's Doug going to be" information, the poll results, the full-sized images, the full-screen directions to racetracks and the audio and video players. (You've got all that here? Yes, but don't worry; I'll explain how to get to it all in later FAQ questions...not as long as this one though!)

     So that's it? HTML, PHP, mySQL and Javascript and here we are? Well, close (I was hoping you weren't going to say that!) There's one more not-so-complicated abbreviation we use. Remember that part about the formatting? Well, what if you had a whole LOT of pages, and you wanted to make them look similar. (Hey, wait...we DO have a lot of pages that we want to look similar!) You could copy the formatting instructions from one page to the next, but that means duplicating your work, and making your users download those same instructions over and over. So the smart people came up with a better way...you can put all those formatting instructions on a different document, and then "link" that document to all the different web pages. A document like that is called a "stylesheet", and the technology to use it on a bunch of different pages is called "CSS" (it stands for "cascading style sheets", and I guess "cascading" means "once you attach it to one web page, it's still avalable for others")

     So there you have it; it's as easy as that. To bring you Doug's Dirt Diary we use html which is sent by PHP connected to a mySQL database, javascript for client-side scripting, and CSS for style. Simple, right?


For more help, to make a comment or just because you want to - click here to contact the Webmaster