Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My CF pages always open in design view

Status
Not open for further replies.

jonkebab

Programmer
May 2, 2001
5
GB
I have links from a html page to various CF pages and when I test them from Internet Explorer they have started either opening the page in design view in CF Studio or bringing up a 'Save As' dialog box as if I was downloading the page from somewhere. I can't work out why. help please!!

 
jsut because your web server doesn't recognize the .cfm extension
add it as a new mime type and eveything will be fine
(please don't tell me you're trying to view the files by opening them in the browser, without a going thru a working web server !!!!)
 
Thanks iza. I've fixed the problem now but don't understand why it was happening! The cfm page that my link points to starts with these lines of code:


<cfquery name=&quot;Messages&quot;
datasource=&quot;Central&quot;
dbtype=&quot;ODBC&quot;>
SELECT Caller_Name, Mess_Details, mess_date_and_time
FROM t_PatheosMessage
</cfquery>
<!--declare an array-->
<!---<CFSET arrMessages=ArrayNew(2)> --->
<!---populate the array--->
<HTML>


The problem seems to hinge around the three commented lines. If I remove any one of them, the page is displayed in the browser. If I leave it as is, the page is opened in CF Studio. Makes no sense to me (though I am an almost complete novice at web development).

Also, when the page does 'run' the query at the top is returned as if I'd entered it as plain HTML text. That suggests to me that I've made a syntax error somewhere because the query runs OK in my SQl client. Any ideas?
 
try a very very simple page, something like :
<html>
<head>
<cfset anyvar=&quot;anything&quot;>
</head>
<body>
hello <cfoutput>#anyvar#</cfoutput>
</body>
</html>
if it displays : &quot;hello #anyvar#&quot; or if it opens in cfstudio, it means that your web server is not correctly set, or that you're not using it
if you call the file with &quot;c:\the_path\the_file.cfm&quot; : you're not using the web server
if you call the file with &quot; : you're using the web server, but it's not correctly set. Go into the admin pages of your webserver, or the config files, and add a new mime type : cfm (the whole details for the new types are in the doc, if you don't have it you might find it at allaire's)
 
I didn't have the http bit, just the template name. Now it works fine. Thanks again.
 
what was the problem ? what did solve it ? (just in case someone has the exact same problem, finds this thread and ... (s)he on't have the solution !!!)
 
Well, your sample code displayed &quot;hello #anyvar#&quot; initially. Then I changed the address that the link was pointing at to &quot; where before it was just &quot;the_file.cfm&quot;. Then it started displaying &quot;hello anything&quot;. So, I assume that the link wasn't using the webserver before.

Is that normal behaviour if you just have the filename in the link address or is there a setting somewhere that ensures that both relative and absolute addresses use the webserver?
 
well, if you don't use the part, browsers suppose you want to read a local file (ok, with some settings you can tell your browser to always add (for instance!) at the begining of the url, but i don't know WHERE to set it)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top