[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Make html pages work like php without changing extension

Posted on 2012-09-05
7
Medium Priority
?
637 Views
Last Modified: 2012-09-06
and with out change any server settings.

is there a header Content-Type: i can use ?
0
Comment
Question by:armasmike
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 1000 total points
ID: 38370919
work like php

It cannot be function the html page as php.  but we can configure on the server the php pages to act as .html extension.
0
 
LVL 36

Assisted Solution

by:Loganathan Natarajan
Loganathan Natarajan earned 1000 total points
ID: 38370927
Because, PHP is a pure server-side programming which will be executed through server.. but HTML is just plain page, it cannot function as PHP
0
 
LVL 31

Assisted Solution

by:Marco Gasi
Marco Gasi earned 500 total points
ID: 38371069
You can simply edit your existing .htaccess file adding this line:

AddType application/x-httpd-php .php .html

If you have not a .htaccess file, simply create a new one empty text file, paste the line aboce and save it as .htaccess with no extension; then place it in your document root directory.

This way, each html page will be treated as a php page.

More info here: http://php.about.com/od/advancedphp/p/html_php.htm

Cheers
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38371164
@marqusG is right (if you are using Apache) but you do have to have PHP installed on the server.
0
 

Author Closing Comment

by:armasmike
ID: 38371847
Yep thats what i thought
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 38371947
I think only the comment ID: 38371069 gave a solution to your problem: breaking points seems a wrong choice...

Good luck with your project
0
 

Author Comment

by:armasmike
ID: 38372418
yes comment ID: 38371069 gave more info on how to do it. But ID: 38370919 say the same thing with out giving all the info. And ID: 38371164 say that it will only work on a server using Apache that i didn't know. So that info was helpful

Also my question saids "with out change any server settings. "

so  ID: 38371069 is changing server settings by editing the .htaccess file.

So i thing breaking points up to all was the right thing to do.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month17 days, 20 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question