This is a multi-part message in MIME format.
------=_NextPart_000_001D_01C0DD47.8EF6F660
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello, I received this copy of an older forum discussion, and seem to be =
having problems with it. It is to create urls that replace ? and =3D =
with / and put html or htm on the end. It seems to work great, until I =
looked at the Cold Fusion Server Log . When you use a url like =
http://www.houseboatrentals.com/lakes.cfm/lake_id/146.html you do get to =
the page just fine. Unfortunately it also creates an error on the Cold =
Fusion 4.5 Server as follows:
"Error","TID=3D1228","05/15/01","09:51:08","192.197.178.2","Mozilla/4.73 =
[en] (WinNT; U)","ODBC Error Code =3D 07001 (Wrong number of =
parameters)<P><P> [Microsoft][ODBC Microsoft Access Driver] Too few =
parameters. Expected 1.<P><B>Hint</B>: The cause of this error is =
usually that your query contains a reference to a field which does not =
exist. You should verify that the fields included in your query exist =
and that you have specified their names correctly.<P><p>The error =
occurred while processing an element with a general identifier of =
(CFQUERY), occupying document position (17:2) to =
(17:51).</p><P><P>Date/Time: 05/15/01 09:51:08<BR>Browser: Mozilla/4.73 =
[en] (WinNT; U)<BR>Remote Address: 192.197.178.2<BR>HTTP Referer: =
http://www.houseboatrentals.com/lakes.cfm/lake_id/146.html<P>"
Now ofcourse I normally know what this means, but in this case, since =
the actual browser finds the site, it has something to do with the =
server. The code I am using in my application.cfm is as follows:
<!--- lets assume we always want to append .html to the end of the URL =
as default --->
<cfparam name=3D"url_suffix" default=3D".html">
<!--- make sure the are at least 2 variables.
a name for the paramenter, and the actual value of the param --->
<cfset length =3D listlen(cgi.path_info, "/")>
<cfif length GT 2>
<cfset param_name =3D "">
<!--- check and remove if found .html or .htm --->
<cfif right(cgi.path_info,5) is ".html">
<cfset url_suffix =3D ".html">
<cfset path_info =3D removechars(cgi.path_info, len(cgi.path_info)-4, =
5)>
<cfelseif right(cgi.path_info,4) is ".htm">
<cfset url_suffix =3D ".htm">
<cfset path_info =3D removechars(cgi.path_info, len(cgi.path_info)-3, =
4)>
<cfelse>
<cfset url_suffix =3D url_suffix>
<cfset path_info =3D cgi.path_info>
</cfif>
=20
<!--- loop through all the items in the 'path_info list'
and set the params --->
=20
<cfloop index=3D"x" from=3D"2" to=3D"#length#">
<cfset param_value =3D listgetat(path_info, x, "/")>
<cfif param_name is "">
<cfset param_name =3D param_value>
<cfelse>
<cfset setvariable(param_name, param_value)>
<cfset param_name =3D "">
</cfif>
</cfloop>
</cfif>
Sorry for so much code, and such a long explanation, but I really need =
to use this, but we don't like all of the errors on our log. Does anyone =
have a fix, or know what the problem is?
Thanks ahead of time!
Greggk
------=_NextPart_000_001D_01C0DD47.8EF6F660
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello, I received this copy of an older =
forum=20
discussion, and seem to be having problems with it. It is to create urls =
that=20
replace ? and =3D with / and put html or htm on the end. It seems =
to work=20
great, until I looked at the Cold Fusion Server Log . When you use =
a url=20
like <A=20
href=3D"http://www.houseboatrentals.com/lakes.cfm/lake_id/146.html">http:=
//www.houseboatrentals.com/lakes.cfm/lake_id/146.html</A>=20
you do get to the page just fine. Unfortunately it also creates an error =
on the=20
Cold Fusion 4.5 Server as follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>"Error","TID=3D1228","05/15/01","09:51:08","192.197.178.2","Mozi=
lla/4.73=20
[en] (WinNT; U)","ODBC Error Code =3D 07001 (Wrong number of=20
parameters)<P><P> [Microsoft][ODBC Microsoft Access Driver] =
Too few=20
parameters. Expected 1.<P><B>Hint</B>: The cause of =
this error=20
is usually that your query contains a reference to a field which does =
not exist.=20
You should verify that the fields included in your query exist and that =
you have=20
specified their names correctly.<P><p>The error occurred =
while=20
processing an element with a general identifier of (CFQUERY), occupying =
document=20
position (17:2) to (17:51).</p><P><P>Date/Time: =
05/15/01=20
09:51:08<BR>Browser: Mozilla/4.73 [en] (WinNT; U)<BR>Remote =
Address:=20
192.197.178.2<BR>HTTP Referer: </FONT><A=20
href=3D"http://www.houseboatrentals.com/lakes.cfm/lake_id/146.html<P"><FO=
NT=20
face=3DArial=20
size=3D2>http://www.houseboatrentals.com/lakes.cfm/lake_id/146.html<P<=
/FONT></A><FONT=20
face=3DArial size=3D2>>"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Now ofcourse I normally know what this =
means, but=20
in this case, since the actual browser finds the site, it has something =
to do=20
with the server. The code I am using in my application.cfm is as=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><!--- lets assume we always want to =
append .html=20
to the end of the URL as default ---></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><cfparam name=3D"url_suffix"=20
default=3D".html"></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><!--- make sure the are at least 2=20
variables.<BR>a name for the paramenter, and the actual value of the =
param=20
---></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><cfset length =3D =
listlen(cgi.path_info,=20
"/")><BR><cfif length GT 2><BR> <cfset param_name =3D=20
""></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2><!--- check and remove if found =
.html or .htm=20
---></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> <cfif right(cgi.path_info,5) =
is=20
".html"><BR> <cfset url_suffix =3D=20
".html"><BR> <cfset path_info =3D =
removechars(cgi.path_info,=20
len(cgi.path_info)-4, 5)><BR> <cfelseif =
right(cgi.path_info,4) is=20
".htm"><BR> <cfset url_suffix =3D=20
".htm"><BR> <cfset path_info =3D =
removechars(cgi.path_info,=20
len(cgi.path_info)-3, =
4)><BR> <cfelse><BR> <cfset=20
url_suffix =3D url_suffix><BR> <cfset path_info =3D=20
cgi.path_info><BR> </cfif><BR> <BR><!--- loop =
through all=20
the items in the 'path_info list'<BR>and set the params=20
---><BR> <BR> <cfloop index=3D"x" from=3D"2"=20
to=3D"#length#"><BR> <cfset param_value =
=3D=20
listgetat(path_info, x, "/")><BR> <cfif =
param_name=20
is ""><BR> <cfset=20
param_name =3D param_value><BR> =20
<cfelse><BR> =
<cfset=20
setvariable(param_name,=20
param_value)><BR> =
<cfset=20
param_name =3D ""><BR> =20
</cfif><BR> </cfloop><BR></cfif></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Sorry for so much code, and such a long =
explanation, but I really need to use this, but we don't like all of the =
errors=20
on our log. Does anyone have a fix, or know what the problem =
is?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks ahead of time!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Greggk</FONT></DIV></BODY></HTML>
------=_NextPart_000_001D_01C0DD47.8EF6F660--
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists