Using PHP Code In Your HTML Files

posted on 20 Oct 2007 21:07 by mixstep
I have this habit of not using .php files if at all possible. It's nothing personal, I simply prefer .html. Whether its more SEO friendly or not is left up to personal opinion and I simply don't have an answer that will agree with the vox populi (as there are very strong opinions on each side). However I do know this, there are a plethora of posts, blogs, and websites touching on this subject. So I figured I'd not only put in my two cents, but also show you how to do this.

So here's the tutorial to add PHP functionality to your HTML pages. (Running PHP code in .html files). To do this you need to be able to modify and use a .htaccess file. If you don't have one and are using an Apache server simply create one in your root web directory. You can speak with your hosting provider for more information on this.

Add these lines to your .htaccess file.
//
AddType application/x-httpd-php .html
//

That's it. Now you can run php code in your .html files. Pretty simple.

So my two cents, basically, I guess I don't have anything to add except I prefer .html files to .php as I've stated. There's nothing wrong with .php files, but a lot of clients I've worked with in the past have specifically requested I not use .php. It can go either way though, .php is easily picked up by search engines just as .html. To each his own in this case.

A common problem people often run into is file hot linking. This is caused when someone links directly to an image or file on your site, using it, without actually hosting it themselves, and in essence, robbing you of your bandwidth. This can be very irritating as bandwidth can be expensive. Here's a couple ways to prevent this.


In order to make this work, you will need access to your .htaccess file. If one does not exist, simply place one in the directory to prevent hot linking. (Apache web servers)


1. To allow everyone except those you choose to deny access to your files and or images. Obviously offendingDomain.tld would be the domain you wish to block from accessing.

//

Default_Referer allow_referer
Order_Referer deny_referer,allow_referer
Deny_Referer from offendingDomain.tld

//

2. To prevent everyone except your website and anyone you choose to allow try this. And yourDomain.tld would be your domain and aDomainYouAllow.tld would obviously be a domain you don't mind hot linking.

//

Default_Referer deny_referer
Order_Referer deny_referer,allow_referer
Deny_Referer from all
Allow_Referer from yourDomain.tld
Allow_Referer from aDomainYouAllow.tld

//
All in all, its pretty simple. Also very effective. If you are having problems making this work, make sure your using an Apache web server (usually on a *nix machine) and that you have permission to modify your .htaccess. Some hosting companies do not allow this. Give them a call, they should help.

Crack Vistaให้เป็น OEM พร้อม Activation อัตโนมัติ และผ่าน Validate จาก MS ตัวล่าสุด Windows Vista All Activator Beta 2-CLoNY

มาใหม่สดๆร้อนๆ จาก keznews.com

คงจำชื่อ CLoNY กันได้ (ก็คนที่ทำ Crack Vista แบบสมบูรณ์ ใช้ได้ทุก version (update 14 ก.พ. 2007)) ยังไงล่ะฮะ

วันนี้ทำตัวใหม่ออกมาอีกแล้ว

ไม่ใช่ Timerstop หรือ Timerlock.

แต่เป็นแครกที่ทำให้ Vista เป็นเวอร์ชั่น OEM พร้อม Activation อัตโนมัติ และผ่าน Validate จาก MS

โดยไม่ต้องไปปรับแต่งแก้ไข BIOS ด้วยตัวเองเลย โปรแกรมจะทำให้หมด

เหมือน Crack Vista แบบสมบูรณ์ ใช้ได้ทุก version คราวที่แล้ว


นี่คือรูปจากเครื่องของผม หลังจากทดลองแล้ว









วิธีทำ

1. ลง Vista โดยไม่ต้องใส่ Key

2. ติดตั้งไฟล์ VistaActivator.msi พอเสร็จแล้วเลือกให้โปรแกรมทำงานหลังการติดตั้ง

3. จะมีหน้าต่าง cmd ขึ้นมา คล้ายๆกับตอนที่ลง Crack Vista แบบสมบูรณ์ ใช้ได้ทุก version

4. เครื่องจะรีสตาร์ทโดยอัตโนมัติ

5. พอกลับเข้ามาที่ Windows ก็จะมีหน้าต่าง cmd ขึ้นมา ก่อน เช่นกัน ตรงนี้ให้รอสักครู่จะขึ้นข้อความว่าแครกสำเร็จ จากนั้นก็เข้า Windows

6. เช็คสถานะการ Activation ของเรา จะพบว่า ได้รับการ Activation เรียบร้อยแล้ว หรือจะเข้าไปตรวจสอบ Validate กับทางเวปของ MS ก็ได้

//รายละเอียดอื่นๆ อ่านได้จากในไฟล์ฮะ

Download: Windows Vista All Activator Beta 2-CLoNY