Chapter 15

Make a Smart Website

Dumb websites don’t change. You get the same content every time you look at them. But a web server is a computer, so you should be able to program it to make a website using code. The code can change the site and make it different every time someone looks at it, or it can make a site that answers questions or allows the user to choose what they see.

image

Understand Smart Websites

Most websites are smart. Facebook, Amazon, Google, Yahoo!, and other big names all have very smart sites. When you view a page on these sites, the web server doesn’t just spit out a page of canned HTML and CSS.

It builds the page from scratch! In fact, it digs into a library of posts, listings, search results, and all kinds of other information. Then it pulls what it needs from the library, mixes it with some HTML and CSS to lay it out and decorate it, and makes a page for you.

Figure 15-1 shows you what you get on one page on eBay. eBay’s web server has built all the photos, menus, links, search boxes, headings, and other text into a page. It does this for every page you look at.

Even simple blog sites are smart. You can search the posts, select posts from a month or year, search for topics, and so on.

Making a big smart site is a lot of work for a lot of people, ...

Get Raspberry Pi For Kids For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.