Let’s Make Some Internet Magic
     

Your listeners expect your station’s website to be filled with eye candy: animated graphics, “what’s playing now” and more. A plain text “Welcome to WXYZ” website just won’t cut it.

Station engineering staff won’t normally be called upon to design and create the content (pages, graphics, etc.) for that website. This will be farmed out to a third party or done by someone on staff using something like Adobe’s popular Dreamweaver package (www.adobe.com/Dreamweaver).

Therefore, I’m not going to cover content creation and Web programming here. There are tutorials online that literally will walk you through this step by step if you’re interested. (One good site is www.w3schools.com.)

Engineering staff will be asked for opinions on technical issues. We’re also expected to help troubleshoot the inevitable problems that crop up.
This edition of “IT stuff that an engineer should know” will take a brief look at what goes on behind your station’s slick Web presence.

BASIC HTML
A classic HyperText Markup Language (HTML) page is a plain text file with embedded “<tags>” that tell your browser how to display it. In most browsers, you can right click in the page and select “View Source.” I won’t cover those tags here in any detail, but I can illustrate with an example.

Fig. 1 is the Engineering page from our company’s website. The HTML source is at the top; the result is at the bottom. “<tag>” switches on an effect and “</tag>” (note the forward slash) turns it back off. For example, the “<b>” tag activates bold text and “<font color=#800000” results in red text.
Another interesting tag is “<img” near the top, which inserts an image. When the browser sees that, it will send a request to the server for the file “images/tower_small.jpg” and insert it in the display. If the file is unavailable, it will insert a stock “broken image” graphic.

The new HTML5 specification supports slick animations, but at present, most are built with Adobe’s Flash. Links to these files (which usually have a “.swf” extension) can also be embedded in HTML. Your browser will fetch the Flash animation and, assuming that you have the Flash Player installed, will display it at the indicated spot in the page.

If we ignore the fancy stuff, though, basic HTML is analogous to a simple word processor. You create a document with tables, bold print and italics, then send that file to your co-workers for viewing. All of the formatting is embedded in the document, just as HTML has these embedded “<tags>.”

DYNAMIC CONTENT
I’ve circled one other interesting feature. The date that I accessed this page was inserted by our Web server. We run a LAMP stack (Linux, Apache, MySQL and PHP — more on this in a moment) for stuff like this. If your Web server has a “stack,” your content creators could insert the line

<?php echo date( “m/d/Y” ) ?>

… into the file for that page and save it with a “.php” extension. Something like “03/06/2013” would be inserted into the HTML for that page, then sent to the browser. I’ll have more on PHP in a moment, but this is called server-side scripting. This is essential for dynamic (i.e., changing/custom) content.

Imagine if you could automate a word processor to do custom search-and-replace just prior to printing and you’ll get the idea. The operative term is “replace.” Before sending that page to your browser, the Web server scans for <?php?> tags, executes the commands and then inserts the result. This is a very basic example too. When you couple server-side scripting with a database, all sorts of slick things are possible. If you click “View Source” in this case, you won’t see the “<?php?>” stuff.

DATABASES

I covered Linux and Apache in the 2011 article “Four Steps to Build a Test Web Server.” Now for the “M” in the LAMP stack, which stands for MySQL, a popular database server.

Databases are the high-tech equivalent of the slotted shelves in your mailroom: different things get stuffed into labeled slots. The “slots” are called “fields” and you can define these any way you like.

My purpose here isn’t to teach SQL; again, there are tutorials on the Web. But the people creating your website’s content will almost certainly want at least one database, because they’re used for all sorts of things nowadays. For example, your database could store info on advertisers, then use a script to pull up different ads for each visitor to your website.

Note that MySQL is just one of many. MariaDB, Microsoft’s SQL (MS-SQL) and Postgresql are some other popular database systems. Your Web server will need to support the database that your content creators want.

CONTENT MANAGEMENT SYSTEMS
Another example is a so-called Content Management System (CMS) like Joomla or WordPress. These allow you to create and edit pages online, then “publish” them with a single click. They’re popular for personal websites and blogs.
When you post a new page with a CMS, it actually stores that page (and associated content, such as graphics) in “chunks” in the database. When a browser requests that page, the CMS assembles it from “chunks” on the fly. It then sends the browser this fresh-baked HTML file for display.
What you may not know is that these CMS packages are just a collection of PHP scripts!

PHP
PHP isn’t the only server-side scripting language. Microsoft’s Internet Information Services (IIS) supports ASP.NET, and there are many others. But PHP is by far the most popular, which is why I’ll discuss it here.

This stands for “PHP: Hypertext Preprocessor” (that’s a “recursive” acronym, referring to itself in the acronym; geeks love the things). It’s a powerful scripting language that runs on the Web server to create custom content on the fly.

I’ve been emphasizing “server side” for a reason. This is the counterpart of JavaScript, another popular Web scripting language that runs on the browser side. That’s why your browser can disable JavaScript, but there’s no way for you to “disable” PHP. Server-side scripting, by definition, occurs before the HTML is ever sent to your browser.

Where PHP really shines is in combination with a database … whence the classic LAMP stack. It’s a complete system for dynamic, custom Web page generation.
As I showed in that simple date example above, PHP commands can be embedded in a regular HTML file with the “<?php” tag. Some files contain nothing but PHP script(s). In either case, these are saved with the “.php” extension. A properly-configured Apache server will see that extension and give that file the “scan, execute and replace” treatment.

A complete, if simplified, example of the process is shown in Fig. 2. We’ve asked our content creators to set up a “current events” page on our website. They’ve created PHP files and have loaded the database with concerts, remotes and other station activities. When someone browses to our “events.php” page, the scripts fetch events from the database and construct an HTML page on the fly.

To repeat: My purpose in showing you this wasn’t to teach you how to use PHP or set up a database. I just wanted you to understand the process so that you could make intelligent decisions if called in to help. And on that note …

IN CLOSING: SITE HOSTING
Not many years ago, it was more cost-effective to build your own server and run it in house. It’s easier and cheaper now just to use a hosting provider. If our company were starting from scratch today, we’d probably do this.

Companies like APlus, Dreamhost and GoDaddy have plans, complete with LAMP stack, starting at a few dollars a month. They’ll register “your-station-slogan.com” with the Domain Name System (DNS). They’ll maintain the server and they’ll provide the bandwidth. Let them handle the headaches! All you need to do is come up with the content, upload it to their server, and you’re done.

What should you look for in a hosting plan? Ask local businesses with nice-looking websites what company they deal with. Get their opinions. Next, as already mentioned, be sure that the provided database is what your content creation team needs.

Beware of bargain-basement, $3-a-month “unlimited” plans. These are usually just a “best-effort” kind of thing with no guarantees. You’re sharing that server with a bunch of other users, all competing with you for processor time and Internet bandwidth. It’s better to get a dedicated server — simply put, a server allocated for your use only. That costs more, but it’s worth it.

If you’re just getting started and don’t know how “big” of a plan to purchase, it’s easy: Just ensure that your hosting provider will be flexible. Ask how difficult it will be to upgrade to a “bigger” plan. You’ll probably find that they’ll bend over backwards; after all, they want your money!
Stephen M. Poole, CBRE-AMD, CBNT, is market chief engineer at Crawford Broadcasting in Birmingham, Ala.

Rating People: 0   Average Rating:     
Comment List:


Post your comment

Your Name:  Required
Your Mail:       Your email will not be published.
Your Site:    

max. 800 characters


Posts are reviewed before publication, typically the next business morning. Radio World encourages multiple viewpoints, though a post will be blocked if it contains abusive language, or is repetitive or spam. Thank you for commenting!