2

Server not emitting .html like PHP

 3 years ago
source link: https://www.codesd.com/item/server-not-emitting-html-like-php.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Server not emitting .html like PHP

advertisements

I have the included code in my .htaccess file but the php code I am attempting to include is not working.

Options +Includes
AddType text/html  .htm .html
AddHandler server-parsed .htm .html
AddType application/octet-stream .vcf
AddOutputFilterByType DEFLATE text/html text/htm text/plain text/css text/php    text/javascript application/x-javascript


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

UPDATE 1

It may be PHP version specific. If you're using PHP5 try:

AddType application/x-httpd-php5 .html .htm

UPDATE 2

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

Or here's yet another alternative way to do this:

<FilesMatch "\.html$">
    ForceType application/x-httpd-php
</FilesMatch>

Related Articles

PHP mail () Function not emitting HTML

I'm trying to send HTML content through PHP mail() function. I don't know what is wrong with my code. I tried many ways, spent hours. but, nothing worked out. Can anyone tell me what is wrong with my code, please? <?php $to = "[email protected]

Can Python be integrated in HTML like PHP and JSP?

Is there a way of writing Python embedded in HTML like I do with PHP or JSP?Use a template engine, such as: Jinja2 (based on Django's templating) mako Cog Cheetah The python wiki also has an article on this topic, with many more suggestions.

@mail not emitting mail in php

This is the first time I am using the mail function. I tried to send a mail using this and the code tells me it's "successfully sent", but I didn't receive any mail. I'm confused reading lots of articles on this. Please help me. <?php if(isse

Moving a file with html and php does not work

'm trying to upload a file(actually move it from a directory to another) using PHP. The problem is, every time i load the html, after i select the file to upload and press submit, it redirects me to a page that actually saves my .php file instead of

HTML & amp; PHP - Do not display the updated image

I'm working on a login service with avatar. I'm also working on a crop-service that should let me crop the photo and then set it as my account's avatar. A just have a form width a file input tag and a submit button. When I click on the "submit"

Validation of JavaScript form with PHP not emitting any e-mail

I have a contact form that uses JavaScript validation for the fields but when I link the form to my PHP, it doesn't send the email. It would greatly appreciated if someone could help me with this. I'm not too familiar with PHP and how it interacts wi

CSS 'active' does not work when converting HTML to PHP includes

I realize a 'similar' question was asked but the other user is using a much different approach than I am. I am simply trying to include an HTML navigation on my PHP pages for easier modification down the road. When you hover over a button, it is high

Character encoding fails, why \ xBD does not display correctly in PHP + HTML

I'm just trying to understand character encoding a bit better, so I'm doing a few tests. I have a PHP file that is saved as UTF-8 and looks like this: <?php declare(encoding='UTF-8'); header( 'Content-type: text/html; charset=utf-8' ); ?><!DOCTYP

Replacing html.tpl.php by node type does not work

I saw that this was asked few times before, and i tried the answers, and i tried modifying the answers, yet nothing. Case: I have advanced forums installed, and i am using appcache(don't you dear to run away now!) Obviously i need to turn appcache of

The session.save_path (/ tmp) value is not writable for the Web server. Make sure that PHP can actually save the session variables

I am trying to install a script on my CentOS VPS, and I managed to resolve most of the errors except of one: The value for session.save_path (/tmp) is not writable for the web server. Make sure that PHP can actually save session variables. I have use

The HTML and PHP mail application does not send it

I trying to make an application form but it just won't work. I've been searching on the site to find some answers, but without luck. - I have tried several different scripts. And the think is I'm using almost the same php script as my contact form bu

Process HTML files like PHP

I've been trying to get .HTML files to process like .PHP files using the .htaccess file, I've used the following, both of which don't work and trying to access the test page gives me an option to download a file that doesn't exist, any ideas? Tried b

php echo string html with php-variables, can not break php string

I'm trying to echo a phpstring-message. This php string consists of html and php variables and comes form a database and i can't change that data. $name = 'John'; $str = '<b>Hi {$name},</b><br/>How are you?'; echo $str; So i'm trying to

JavaScript does not work with HTML and PHP

I'm trying to create a simple registration form with basic HTML and PHP to insert data to my database. Basically, I want to validate the fields first before inserting the data and so I have created an external JavaScript file. Problem is, it is displ

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK