473,785 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parse .cfm files

I have a bunch of files with the extension .cfm with PHP code in them.
It's a long story, but I need to keep the extension the same.
Is there a way to make PHP parse the .cfm file?
My web host says they can't do it on their end.
Should I argue?

Matthew

Oct 29 '06 #1
13 3807
Matthew256 wrote:
I have a bunch of files with the extension .cfm with PHP code in them.
It's a long story, but I need to keep the extension the same.
Is there a way to make PHP parse the .cfm file?
My web host says they can't do it on their end.
Should I argue?

Matthew
I can't say as I blame them. I wouldn't want to try adding non-standard
extensions like this for every client.

If this is Apache, they could with an AddType directive in the
httpd.conf file. You could do it in the .htaccess file.

But .cfm is a Cold Fusion template file. Why would you have php code in it?

You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 29 '06 #2
Matthew256 wrote:
I have a bunch of files with the extension .cfm with PHP code in them.
It's a long story, but I need to keep the extension the same.
Is there a way to make PHP parse the .cfm file?
PHP doesn't care about extensions.

fopen(), fread(), and fclose() come to mind.
If the .cfm is plain text I'd use file() instead.

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Oct 29 '06 #3
Add the following line to the .htaccess file in the directory (If there
is one, if not create it)

AddType application/x-httpd-php .php .cfm #add any other extentions
you want to be parsed
Hope this helps,
--Joel
On Oct 29, 1:53 pm, "Matthew256 " <PRESENT...@gma il.comwrote:
I have a bunch of files with the extension .cfm with PHP code in them.
It's a long story, but I need to keep the extension the same.
Is there a way to make PHP parse the .cfm file?
My web host says they can't do it on their end.
Should I argue?

Matthew
Oct 29 '06 #4
Jerry Stuckle wrote:
>
But .cfm is a Cold Fusion template file. Why would you have php code in it?

You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.
My guess is that the OP needs to preserve the URLs in existing links.
This is probably better handled through Apache rewrite than changing
the file extension of the source files.

Oct 30 '06 #5
Chung Leong wrote:
Jerry Stuckle wrote:
>>But .cfm is a Cold Fusion template file. Why would you have php code in it?

You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.


My guess is that the OP needs to preserve the URLs in existing links.
This is probably better handled through Apache rewrite than changing
the file extension of the source files.
A 301 redirect takes care of things quite nicely - and permanently.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 30 '06 #6

Jerry Stuckle wrote:
Chung Leong wrote:
Jerry Stuckle wrote:
>But .cfm is a Cold Fusion template file. Why would you have php code in it?

You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.

My guess is that the OP needs to preserve the URLs in existing links.
This is probably better handled through Apache rewrite than changing
the file extension of the source files.

A 301 redirect takes care of things quite nicely - and permanently.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
One would use rewrite to do that, naturally.

Oct 30 '06 #7
NC
Matthew256 wrote:
>
I have a bunch of files with the extension .cfm with PHP code in them.
It's a long story, but I need to keep the extension the same.
Is there a way to make PHP parse the .cfm file?
Yes. You can add an AddType directive to httpd.conf.
My web host says they can't do it on their end.
What they mean to say is that they don't WANT to do it. It requires
changing Apache configuration file, which is against policy in many
Web hosting companies.
Should I argue?
You can argue, but it is probably going to be futile.

Cheers,
NC

Oct 30 '06 #8
Chung Leong wrote:
Jerry Stuckle wrote:
>>Chung Leong wrote:
>>>Jerry Stuckle wrote:
But .cfm is a Cold Fusion template file. Why would you have php code in it?

You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.
My guess is that the OP needs to preserve the URLs in existing links.
This is probably better handled through Apache rewrite than changing
the file extension of the source files.

A 301 redirect takes care of things quite nicely - and permanently.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@att global.net
============= =====


One would use rewrite to do that, naturally.
You can use a rewrite. But a redirect will allow the search engines to
pick up the change without affecting current page rank. So eventually
you can get rid of your redirects.

If you just do a rewrite no one will know it's actually changed.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Oct 30 '06 #9

Jerry Stuckle wrote:
Chung Leong wrote:
Jerry Stuckle wrote:
>Chung Leong wrote:

Jerry Stuckle wrote:
But .cfm is a Cold Fusion template file. Why would you have php code in it?

You'll be much better off in the long run if you change the extension to
something standard like .php. Or just get yourself a virtual private
server where you can do anything you want.
My guess is that the OP needs to preserve the URLs in existing links.
This is probably better handled through Apache rewrite than changing
the file extension of the source files.
A 301 redirect takes care of things quite nicely - and permanently.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attg lobal.net
============== ====

One would use rewrite to do that, naturally.

You can use a rewrite. But a redirect will allow the search engines to
pick up the change without affecting current page rank. So eventually
you can get rid of your redirects.
The easiest way to perform the redirection is with a rewrite rule, with
the R=301 flag.

See http://httpd.apache.org/docs/2.0/mod...ml#rewriterule

Oct 30 '06 #10

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

Similar topics

6
5183
by: Els | last post by:
***newbie question*** Hi, I am trying to make my server (Apache) parse .html files as .php. I found this line of code: ForceType application/x-httpd-php placed it in an .htaccess file and uploaded it to the directory I wanted it to work. And it worked; my .html files are all parsed as .php.
22
7124
by: Illya Havsiyevych | last post by:
Hello How easily parse VB/VBA code by VB/VBA code ? Is any ready solutions ? Thank's, illya
19
3222
by: Johnny Google | last post by:
Here is an example of the type of data from a file I will have: Apple,4322,3435,4653,6543,4652 Banana,6934,5423,6753,6531 Carrot,3454,4534,3434,1111,9120,5453 Cheese,4411,5522,6622,6641 The first position is the info (the product) I want to retreive for the corresponding code. Assuming that the codes are unique for each product and all code data is on one line.
21
2674
by: William Stacey [MVP] | last post by:
Anyone know of some library that will parse files like following: options { directory "/etc"; allow-query { any; }; // This is the default recursion no; listen-on { 192.168.0.225; }; forwarders { 4.2.2.2; }; };
7
3729
by: akira | last post by:
Hello, I need to parse this XML file or XML stream . Is it possible to parse it with DOM reading each DataContainer one by one. <DataContainer> <name> </name> <birthDate> </birthDate> <personnalInfos> <personnalInfo_entries> </personnalnfo_entries> <personnalInfo_elem> </personnalnfo_elem>
14
7352
by: Rob Meade | last post by:
Hi all, I'm working on a project where there are just under 1300 course files, these are HTML files - my problem is that I need to do more with the content of these pages - and the thought of writing 1300 asp pages to deal with this doesn't thrill me. The HTML pages are provided by a training company. They seem to be "structured" to some degree, but I'm not sure how easy its going to be to parse the page.
5
64651
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called this article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
1
64196
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this article “How to Parse a File in C++”, we are actually mostly lexing a file which is the breaking down of a stream in to its component parts, disregarding the syntax that stream contains. Parsing is actually including the syntax in order to make...
1
2353
by: Baron Samedi | last post by:
I have been searching, unsuccessfully, for a program which will parse header files and generate stubs for all external declarations (classes, functions, <shudderglobal variables). I want this so that I can generate dummies for interfacing software, for unit testing. As I say, I haven't found it, so it looks like I will have to code my own. Before I reinvent the wheel, does anyone know of any freely available software to parse header...
1
2212
by: jo3c | last post by:
hi everybody im a newbie in python, i have a question how do u parse a bunch of text files in a directory? directory: /dir files: H20080101.txt , H20080102.txt,H20080103.txt,H20080104.txt,H20080105.txt etc...... i already got a python script to read and insert a single text files
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.