arrow_upward

Pages (2):
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making .html like .php
#1
BIG EDIT!
this tutorial haven't worked for me personally! but this .htaccess file worked for me!
Download: http://pastebin.com/download/q1mpgzU1
RAW: http://pastebin.com/raw/q1mpgzU1
Pastebin: http://pastebin.com/q1mpgzU1


Hello,

Have you ever tested to make 'for example' an blog system written in ".HTML" files?
This tutorial will let some of your website visitors to be amazed that's you have login,register,logout,etc... system written in .html
CAUTION: I know! a lot of people will understand this thread incorrectly... please be careful this thread let you know how to make .html files execute PHP Wink

So let's start! it's super simple.
  • Edit ".htaccess"; or ... create a new file named ".htaccess" (if it doesn't exists)
  • Add this line at the first line of ".htaccess"
AddHandler x-httpd-php .html .htm

That's all for the steps Wink

will this disallow .php? No! it will allow PHP to be executed with ".php" ".html" ".htm"
BUT! in some Nginx servers it will disallow ".php"

So edit the above line with this:
AddHandler x-httpd-php .html .htm .php .php5 .php3

while the different is "we've added .php & .php5 & .php3 at the end of the line!"


Verifying if it worked!


* create an file and name it "anything.html" .
in this file add:
<?php
echo "test!";
?>


Thank you & best regards,

AzureWeb's main CEO & Founder.
#2
Why on earth would you want this?
PHP is PHP. HTML is HTML.

Nginx doesn't work with Apache rules/ .htaccess files Wink
#3
LOL PHP is a script language, HTML is the structure website.. but i guess its not possible if u try make login access with html. u will need PHP but for the permanent save, use Database
#4
(01-07-2016, 01:08 PM)han105 Wrote: LOL PHP is a script language, HTML is the structure website.. but i guess its not possible if u try make login access with html. u will need PHP but for the permanent save, use Database

What I meant to say by all is to add ".html" file-types as an PHP handler, not more...
Also @Han105, I didn't meant to say "HTML have a lot of functions as PHP" I just tell you how to run PHP with .html files Wink
#5
(01-07-2016, 01:11 PM)azureweb Wrote:
(01-07-2016, 01:08 PM)han105 Wrote: LOL PHP is a script language, HTML is the structure website.. but i guess its not possible if u try make login access with html. u will need PHP but for the permanent save, use Database

What I meant to say by all is to add ".html" file-types as an PHP handler, not more...
Also @Han105, I didn't meant to say "HTML have a lot of functions as PHP" I just tell you how to run PHP with .html files Wink
But isn't it just as easy/convenient to just change the extension? From .html to .php at the end result? Or am I doing something wrong.
#6
(01-08-2016, 01:26 AM)Mr.Monkey Wrote:
(01-07-2016, 01:11 PM)azureweb Wrote:
(01-07-2016, 01:08 PM)han105 Wrote: LOL PHP is a script language, HTML is the structure website.. but i guess its not possible if u try make login access with html. u will need PHP but for the permanent save, use Database

What I meant to say by all is to add ".html" file-types as an PHP handler, not more...
Also @Han105, I didn't meant to say "HTML have a lot of functions as PHP" I just tell you how to run PHP with .html files Wink
But isn't it just as easy/convenient to just change the extension? From .html to .php at the end result? Or am I doing something wrong.

No dear.
#7
Azureweb, can you provide me some possible scenarios where this would be helpful?
I can't imagine a single one!

A proper PHP script is written in pure PHP, so why you would like to save it as a HTML is a mystery to me.
#8
This is entirely stupid. One misconfiguration and those php scripts are public.
Those blog systems that has the html extension uses plugins to generate static html to prevent huge load everytime someone browses their site.
http://FreeVPS.club - Free VPSs!
#9
Guys I agree with it! I just give an tutorial if it's needed only.

"Parsing PHP with HTML files"
That's only.
#10
I agree with RickB, I can't imagine ANY scenario where you would need this! PHP extensions are just fine for me, and I'm sure its the same for everyone else.
Pages (2):


person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting