473,394 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how can i use php in .htm file

i have a site in a host with adomain
i can run php with .php files
but i can 't use php in .htm file.
how can i do this
Jul 17 '05 #1
4 3240
if you dont controll the server, easy way is to just use .php file
extentions, that how everyone uses php, its just an .html fiel with php in
it, the .php tells the server to ececute the code.

now some people do tell the server to parse .html files for php, but its a
waste of time, and server load
--
Mike Bradley
http://gzen.myhq.info -- free online php tools
"berehneh" <fe*************@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
i have a site in a host with adomain
i can run php with .php files
but i can 't use php in .htm file.
how can i do this

Jul 17 '05 #2
One way is iframe or ilayer technique..

for example the following includes a php file inside html and works as if it
was a frame..
Use google for more information.

<IFRAME SRC="http://www.server.com/includedFile.php" WIDTH=135 FRAMEBORDER=0
SCROLLING=NO HEIGHT=80></IFRAME>
"berehneh" <fe*************@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
i have a site in a host with adomain
i can run php with .php files
but i can 't use php in .htm file.
how can i do this

Jul 17 '05 #3
create a .htaccess file

add the line:
AddHandler application/x-httpd-php .htm

upload to where you would like your .htm files to be parsed as php

this will now parse all .htm files as php

to get htm files to be parsed normaly remove the .htaccess for or delete the
line you added.

this will be my last post on this if you read you'll understand.
good luck

"berehneh" <fe*************@hotmail.com> wrote in message
news:42**************************@posting.google.c om...
i have a site in a host with adomain
i can run php with .php files
but i can 't use php in .htm file.
how can i do this

Jul 17 '05 #4
fe*************@hotmail.com (berehneh) wrote in message
news:<42**************************@posting.google. com>...

i have a site in a host with adomain
i can run php with .php files
but i can 't use php in .htm file.
how can i do this


See Andrew Disley's post in this thread, but are you sure
you want to do this? PHP files have a different extension
for a reason. Parsing and executing PHP files takes time.
If you make the switch you want, all HTML files will be
parsed as PHP files regardless of whether or not they have
any PHP inside them.

Also, if you have HTML files that currently use SSL (Server
Side Includes), SSL will stop working if you instruct the
server to process HTML files as PHP...

So my advice to you is, stick with existing extensions;
they are there for a reason...

Cheers,
NC
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
7
by: Joseph | last post by:
Hi, I'm having bit of questions on recursive pointer. I have following code that supports upto 8K files but when i do a file like 12K i get a segment fault. I Know it is in this line of code. ...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
1
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved...
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
0
by: troutbum | last post by:
I am experiencing problems when one user has a document open through a share pointing to the web site. I use the dsolefile to read the contents of a particular directory and then display them in a...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.