Create RSS Feed in PHP

View this post in :English or Indonesian

This is the easiest way to build a RSS feed in PHP. Because we don’t have to modify the feed file (feed.xml, or another xml file) anymore every we adding more content into the site.. And here’s the key concept:

Every the PHP file executed, the PHP file will output XML-based data to the browser by modifiying the PHP’s header.

In order to output a XML-based data by PHP, you will need to put this line into the PHP script:

header(’Content-Type: text/xml; charset=UTF-8′, true);

the line above will send an xml file to your browser with XML format. Read the rest of this entry »

.htaccess Tricks: #2 – Essentials

View this post in :English or Indonesian

Commenting your htaccess Files

It is an excellent idea to consistenly and logically comment your htaccess files. Any line in an htaccess file that begins with the pound sign ( # ) tells the server to ignore it. Multiple lines require multiple pounds and use letters/numbers/dash/underscore only:

# this is a comment
# each line must have its own pound sign
# use only alphanumeric characters along with dashes - and underscores _

Read the rest of this entry »

.htaccess Tricks: #1 – Definition

View this post in :English or Indonesian

.htaccess Tips n Trick

.htaccess Tips n Trick

.htaccess definition:
Apache server software provides distributed (i.e., directory-level) configuration via Hypertext Access files. These .htaccess files enable the localized fine-tuning of Apache’s universal system-configuration directives, which are defined in Apache’s main configuration file. The localized .htaccess directives must operate from within a file named .htaccess. The user must have appropriate file permissions to access and/or edit the .htaccess file. Further, .htaccess file permissions should never allow world write access — a secure permissions setting is “644”, which allows universal read access and user-only write access. Finally, .htaccess rules apply to the parent directory and all subdirectories. Thus to apply configuration rules to an entire website, place the .htaccess file in the root directory of the site.
Read the rest of this entry »