The Best Listen On The Net Web site

  Listen On The Net
The time for standing in place is gone and anyone who wants the best in ledbelly sound studios should understand that. There are many people who want to know more about ledbelly sound studios and since you are here you must be one of them. Anyway we are happy to have you as a visitor and want to make your visit worthwhile.

There are a number of ledbelly sound studios websites on the Internet as you surely know. Some are worthwhile and others are completely worthless. We pride ourselves on providing only the most valuable information on ledbelly sound studios available.
HTACCESS Wrappers with PHP

 by: Robert Plank

HTACCESS is a remarkable tool you can use for password protection, error handling (like custom 404 pages), or HTTP redirects. It can also be used to transform whole folders in seconds: adding headers to all your HTML documents, watermarking all your images, and more.

A wrapper is like a middleman. Using htaccess you can tell your web server to "forward" certain files to PHP scripts of yours. When a visitor tries to load an image in their browser, you could activate a script that adds a watermark to the image. When an HTML page is loaded you could query an IP-to-country database and have your HTML pages translated into the native language of your visitor's country-of-origin.

Every file in a folder, or all files of a certain type in a folder, can be instructed to go through a PHP script.

TORTILLA WRAP

Pretend you host several affiliate sites, or a full-blown hosting service like Geocities. Most sites running on free hosting services have some kind of advertisement the owners use to generate revenue. These aren't applied voluntarily by the users of these services. The ads don't even show up on their source files, just when displayed on the web.

It's possible to replicate this feature using less than 10 lines of PHP and htaccess code. To start off, make a folder on your web host called "header". Create a new text file and enter the following:

AddHandler headered .htm


AddHandler headered .html

Action headered /header/header.php

This designates files with the extension ".htm" and ".html" to a type called "headered". The name "headered" can really be anything, it's just a way of labeling a group of files. The last line there tells the web server that if any of the file types in the group called "headered" are called, we should instead execute the script "/header/header.php". This is the relative path, so if your URL is http://your.host, this will run http://your.host/header/header.php.

That's all you've got to do for the htaccess file. Save that as "htaccess.txt" -- we'll get back to it later.

For the actual wrapper, create a new text file with the standard tags, then assign your header and footer file names to variables called $header and $footer.

$header = "header.html";


$footer = "footer.html";

Redirecting a user to our script doesn't pass its contents to it, just the filename. If you call phpinfo() in your script and scroll to the bottom you can see all the server variables which give us the name. The element "REQUEST_URI" in $_SERVER gives us the relative path (/header/sample.html), but we want the full system path since we're going to be reading the actual file (/home/username/wwwroot/your.host/header/sample.html), which is "PATH_TRANSLATED".

$file = $_SERVER["PATH_TRANSLATED"];

The name of the file that just tried to be shown is now stored in the variable $file. Three simple things are left: output the header, output the actual file, then output the footer.

readfile($header);


readfile($file);


readfile($footer);

That's it. Here's the entire header.php file:

All that, in just nine lines of code. Download it here: http://www.jumpx.com/tutorials/wrapper/header.zip

That contains the htaccess file and PHP wrapper script, along with a sample header, footer, and a test page. Upload all five files to your web host, chmod htaccess.txt to 0755 then rename it to ".htaccess". It might disappear from your directory listing which is okay, it should still be there.

Load, in your browser, the copy of sample.html residing on your web server. The text "This is my header" should appear at the top while "This is my footer" should show on the bottom. If you open up the actual file called sample.html, you'll see that these actually aren't there. They've been added in by the script all HTML files in the folder "header" must now pass through.

This is how wrappers work. Certain things, like adding custom headers and footers are done "on the fly" without modifying your original file. You'll get the same effect if you create other HTML files and upload them to this folder.

Files without ".html" or ".htm" extensions, such as text files or images, won't show these headers or footers. This is a good thing because text files aren't part of the presentation on a web site and adding extra text to images will corrupt them. It affects all HTML files within your /headers folder, and none of the files outside of it.

If you wanted, you could add or remove any file extensions you want, just by adding or taking away those "AddHandler" lines.

To get everything back to normal, either delete your .htaccess file or upload a blank .htaccess file in that folder, and all will be well again.

SHRINK-WRAP

The same basic formula can be applied again for other uses -- HTTP compression, for example. This was an idea that used to be impractical because computers ran at slower speeds, and is now obsolete because of broadband technologies (DSL and cable).

It works like this: when an HTML page is loaded, the web server instead gives the visitor a zipped or compressed version of that page. The visitor downloads that file, which of course takes up less space than the real thing and downloads in less time, then unzips it and displays the original page.

In this age of lighting fast DSL lines, there's almost no noticeable difference. However, if you have a site that hosts large files whose audience is mostly dialup users, it might be something to look into.

Make a new folder called "compress". Create your htaccess file again, just as before, but set the extensions to include .htm, .html, and .txt. (The group name, folder name, and script name have nothing to do with one another, you can name any of these whatever you like -- I just like things to match.)

Our wrapper script for this should be called "compress.php". That's what I'm naming mine. This means the htaccess file you have should look as follows:

AddHandler compress .html


AddHandler compress .htm


AddHandler compress .txt

Action compress /compress/compress.php

If our wrapper were simply going to pass through the file (in other words, just read its contents into a variable and display it), our handler script would look like this:

"GIFT WRAPPING" YOUR OUTPUT

To make the HTTP compression work, we use two functions: ob_start() and ob_gzhandler(). Output buffering functions are strange. Any time you try to display something, you can have PHP save up everything you're trying to output. At the very end it's all dumped into a function of your choosing where the text can be changed or transformed before it's output.

There is a built-in PHP function called ob_gzhandler() which takes one parameter (a string of text), compresses the data according to the gzip standard and does all the header trickery that's needed to tell the user's browser that we are transmitting data that needs to be decompressed once it's downloaded. When this line is used:

ob_start("ob_gzhandler");

It tells PHP: everything displayed afterwards has to go through the function ob_gzhandler() first. Put that at the top of our script and here's what we've got:

Save that as compress.php. Upload both files, chmod htaccess.txt to 0755 and rename to .htaccess and you're done. That's all you need for it to work, and you can just as easily apply HTTP compression to any script by just adding that line.

To try this puppy out, I got on a dialup connection and put a copy of "The Decline And Fall Of The Rom

ledbelly sound studios

Listen On The Net
Need information on Internet Radio, audio or entertainment? Look no further - you've found a great repository for all of this information. If you want to listen to music or even to listen to free music just follow our sponsored links and you will find some great information.
Listen On The Net

Hints and tips when you are searching for ledbelly sound studios. Well the first thing to do is type in the exact phrase that you are looking for, but I guess that you already know that seeing that you've just searched for ledbelly sound studios and this web page came up.

The biggest tip that I've got is not to bother looking any further. You have already struck the Eldorado of ledbelly sound studios information. The leaders of the pack. The holy grail of Internet info on the sometimes not so easy to find subject of ledbelly sound studios.


That's not to say you're at that page right now, because our ledbelly sound studios site is too new to be the best in the field, or even in the top 10 websites. But the Internet sites that we link to above are the leaders of the pack.
WDBZ's Mr. Listen On The Net WDBZ's Mr. Listen On The Net WDBZ's Mr. Listen On The Net WDBZ's Mr. Listen On The Net WDBZ's Mr. Listen On The Net WDBZ's Mr. Listen On The Net

Home | Site Map | ledbelly sound studios | master sound studios | mastering | masterphonics | mirror sound studios | new sound studios | nonstop sound studios | portland sound studios | post production

Sign up for PayPal and start accepting credit card payments instantly.

Main Menu
Listen On The Net
Site Resources

Free Tell A Friend from Bravenet.com

News for 11-Jan-12

Source: BBC News - Home
Police killed in Afghan firefight

Source: BBC News - Home
Henry return a 'dream' for Wenger

Source: BBC News - Home
Obama's chief of staff steps down

Source: BBC News - Home
US Republicans face fresh contest

Source: BBC News - Home
In pictures: ANC celebrates 100 years

Source: BBC News - Home
Philips results 'to disappoint'

Source: BBC News - Home
US carmakers see boost from China

Source: BBC News - Home
High-speed rail line to go ahead

Source: BBC News - Home
Deadly blast at Pakistan bus stop

Source: BBC News - Home
Rise in French industrial output

Search the Web
ledbelly sound studios
master sound studios
mastering
masterphonics
mirror sound studios
new sound studios
nonstop sound studios
portland sound studios
post production
postdigital

Last Updated: Wednesday, 11-Jan-2012 00:01:41 MST
Copyright © 2004 :: Listen On The Net
Talk On The Net :: Medical Presentations :: Medical Newscast :: Take Your Meds

Listen On The Net

Fantasy Football Update   Go Meetings   Medical Meetings On The Net