How Websites Work

For those who are unfamilar with how websites operate, here is a basic rundown of how the parts fit together, just so we have an idea of the overall structure. I know there are people here that know more about this than I do, so correct me on parts that I am mistaken on, and post more detail about the confusing parts, etc.

Basically there are programing languages that run on the web server, and programming languages that run on Internet Explorer and Firefox, etc. It is also important to note that with websites, we use programming languages to write programming languages. For example, it is possible to use python to write some javascript code that will write some html code, once it is sent to the browser.

On the web server, there is a central program that talks directly with Internet Explorer or Firefox and will find and send the pages that they ask for. Apache is an open source program that does this well, and has been the most popular web server in the last 10 years. Another is Microsoft's IIS (Internet Information Server). If the page being requested matches a certain name, location, or type, Apache will ask PHP, Python, Perl, or other programs to process a page before it is sent back to the browser. These scripting languages are the rulers of the web server. They have a lot of power to create a page to be sent back to Apache. There are many scripts written in these languages like Drupal, Django, MediaWiki, WordPress, etc. They usually use a database to store information while the script is not running. Examples of databases are MySQL, PostgreSQL, Oracle, etc.

Once the web server has decided what it wants to send to the browser, the browser interprets the page. There is not much choice in the use of languages here, it is mostly whatever the browser supports. The page comes in HTML, the language that makes a web page a web page. In the HTML code, there will be links or pointers to Images (JPG, GIF, etc), Stylesheets (CSS), Information Feeds (RSS), Javascript, and embedded content like Flash media, Quicktime videos and Java applets. Style sheets define general things like what color and font the text is and how much space should be between the sidebar and the main content. Javascript, however is the ruler of the web browser programing languages because it can manipulate the HTML and the styles, and even add to them. Javascript runs while the user is reading the web page and allows the user to interact with the page. It brings the page alive. But then again, pages with javascript can easily become annoying and simple HTML is enough for a neat looking webpage.

This may seem a bit overwhelming, but most of the time it is possible to work with only two componets at once, and the others are ignored. For example CSS and HTML, Python and HTML, Python and the database, etc.

Nice!

Collin, that's a great description! I wouldn't add much myself. One thing I do want to stress, though, is the ease of use of HTML. I always liken HTML to a Word document because when it gets to your browser, it is very static and not like a program on your computer (unless, of course, it uses JavaScript). Because it is much like a Word document, all a webpage really is is writing bold and italics, a line break here, etc. Of course, the place it gets harder is in your use of CSS, but even a couple easy stylesheets can make your webpage look pretty.

Even if we write everything in Python, everything that's output to the browser is in HTML. So it would be good to have a good grasp on HTML. Don't worry, it's not hard. I taught myself how to do it eight years ago.

Dan Ficker
Webmaster
Emmaus Project
Music: inReview.net
Blog: da-Man.com/blog

Steal Source Code

regarding HTML and everything else the browser presents to the surfer, this brings up a great way to learn from the pro's.

The programs on the server are only sending you their output, so sometimes it can be difficult to understand how they work unles you have separate access to their source code. However, the programs that are in the web browser are usually sent to you in the form of the source code, which your browser will on-the-fly generate into a program. What am I getting at? Another method of learning:

Every browser has a "View Source" feature. Use it often... it's just like learning piano by ear... go find a webpage that you like, study it, and then study the source code and you will see exactly how to do what they did. Then you can even copy bits of their source code into a file on your computer, and then open that file in your browser and notepad and commence with the tweaking.

Thats how I learned HTML

Thats how I learned HTML. I looked at the source and I looked at the page, and kept going back and forth.

Also, Google docs has an "Edit HTML" tab where you can see the html of what you wrote.

Gret Resources

Speaking of Editing HTML and web development, there are a couple things that you definitely need. First of all, if you're not using FireFox, your user account for this site may be deleted. (Just kidding.)

Second of all, check out my blog post on FireFox Plug-Ins. The most essential is the Web Developer plug-in. Install that toolbar and then you can easily view the CSS, Disable Cookies or JavaScript, as well as many other things. There is even an option to have the HTML of the site show up in a sidebar and you can just edit away and see the changes!

Dan Ficker
Webmaster
Emmaus Project
Music: inReview.net
Blog: da-Man.com/blog

database for emmausproject

Any ideas about which database we ought to use for emmausproject (MySQL, PostgreSQL, Oracle, etc)?
-Abe

I vote MySQL

I like MySQL because it's simple and I know how to use it. I wouldn't object to Postgres because I hear good things about it. I've played with Oracle in school and for a project like this it's not worth it.

Oracle is for huge companies. It's expensive. As my database professor said, and he was a real Oracle fan, "a small database is a couple million records."

Dan Ficker
Webmaster
Emmaus Project

Agreed

I would agree that Oracle is a "last possible choice" type of option (unless I'm grossly underestimating the revenue of this operation ;-). You might be able to get a weakened free version, but that doesn't make it any less cumbersome to work with.

The choice between PostgreSQL and MySQL is a tough one. MySQL is incredibly easy to use and has a lot of good, free tools (phpMyAdmin), plus, somewhat recently, it added support for views and a few other features that held it back from being considered a "real" rdbms.

---
Chuck Riley
charlesriley1@gmail.com
Mishawaka, IN

PostgreSQL versus MySQL

I stumbled across this comparison today. It is from February 2005, so a lot of the features it says MySQL is "working on" are now done.

PostgreSQL versus MySQL

---
Chuck Riley
charlesriley1@gmail.com
Mishawaka, IN