this page has 2 URL parameters the first check for a number of vehicles to be quooted to act as sort of a loop to allow the user to quote a specific number of autos. The second checks for a "return" param which is set to 1 when the user returns to add another vehicle. This page is giving me all sorts of problems. Safice it to say none of the parameters are working the page always goes to "quote3.cfm" regardless of what parameters are entered.
Does anyone see a syntax issue or something that is wrong ive gone over and over it.
Zeke
<cfparam name="URL.carID" default="1">
<cfparam name="URL.return" default="0">
<cfif URL.return eq 0>
<cfset ret = "quote3.cfm">
<cfset lab = "Add Vehicle">
<cfelse>
<cfset ret = "summary.cfm">
<cfset lab = "Add Vehicle">
</cfif>
<cfset howmany = (#URL.carID# - 1)>
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">
<cfquery datasource="wallrich">
INSERT INTO quoteVehicle (trackID, vehDriver, vehYear, vehMake, vehModel, vehVin,
vehUse, vehAlarm, vehAnnualMiles, vehMiles1way, vehBI, vehPD, vehUI, vehUNI,
vehMed, vehComp, vehColl, vehTow, vehRR, vehOwnership, vehNotes) VALUES (
<cfif IsDefined("FORM.trackID") AND #FORM.trackID# NEQ "">
#FORM.trackID#
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehDriver") AND #FORM.vehDriver# NEQ "">
'#FORM.vehDriver#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehYear") AND #FORM.vehYear# NEQ "">
'#FORM.vehYear#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehMake") AND #FORM.vehMake# NEQ "">
'#FORM.vehMake#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehModel") AND #FORM.vehModel# NEQ "">
'#FORM.vehModel#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehVin") AND #FORM.vehVin# NEQ "">
'#FORM.vehVin#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehUse") AND #FORM.vehUse# NEQ "">
'#FORM.vehUse#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehAlarm")>
'Y'
<cfelse>
'N'
</cfif>
,
<cfif IsDefined("FORM.vehAnnualMiles") AND #FORM.vehAnnualMiles# NEQ "">
'#FORM.vehAnnualMiles#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehMiles1way") AND #FORM.vehMiles1way# NEQ "">
'#FORM.vehMiles1way#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehBI") AND #FORM.vehBI# NEQ "">
'#FORM.vehBI#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehPD") AND #FORM.vehPD# NEQ "">
'#FORM.vehPD#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehUI") AND #FORM.vehUI# NEQ "">
'#FORM.vehUI#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehUNI") AND #FORM.vehUNI# NEQ "">
'#FORM.vehUNI#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehMed") AND #FORM.vehMed# NEQ "">
'#FORM.vehMed#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehComp") AND #FORM.vehComp# NEQ "">
'#FORM.vehComp#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehColl") AND #FORM.vehColl# NEQ "">
'#FORM.vehColl#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehTow") AND #FORM.vehTow# NEQ "">
'#FORM.vehTow#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehRR") AND #FORM.vehRR# NEQ "">
'#FORM.vehRR#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehOwnership") AND #FORM.vehOwnership# NEQ "">
'#FORM.vehOwnership#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.vehNotes") AND #FORM.vehNotes# NEQ "">
'#FORM.vehNotes#'
<cfelse>
NULL
</cfif>
)
</cfquery>
<cfif #howmany# gt 0>
<cflocation url="vehicle.cfm?carID=#howmany#">
<cfelse>
<cflocation url="#ret#">
</cfif>
</cfif>
<cfquery name="getDrivers" datasource="wallrich">
SELECT drvFname FROM quoteDriver WHERE trackID = #Client.trackID# ORDER BY drvFname
ASC
</cfquery>
<cfquery name="getYear" datasource="glossen">
SELECT "year" FROM ins_menu_caryear
</cfquery>
<cfquery name="getUse" datasource="glossen">
SELECT use FROM ins_menu_vehUse
</cfquery>
<cfquery name="getLiab" datasource="glossen">
SELECT liab FROM ins_menu_liability
</cfquery>
<cfquery name="getmed" datasource="glossen">
SELECT med FROM ins_menu_medpay
</cfquery>
<cfquery name="getded" datasource="glossen">
SELECT * FROM ins_menu_deductible
</cfquery>
<cfquery name="getRent" datasource="glossen">
SELECT rental FROM ins_menu_rental
</cfquery>
<cfquery name="gettow" datasource="glossen">
SELECT tow FROM ins_menu_towing
</cfquery>
<cfquery name="getOwnership" datasource="glossen">
SELECT status FROM ins_menu_ownerStatus
</cfquery>
<cfquery name="getPDliab" datasource="glossen">
SELECT liab FROM ins_menu_ppliability
</cfquery>
<CFsignature Thank You All></CFsignature>
<cfif #howmany# gt 0>
<cflocation url="vehicle.cfm?carID=#howmany#">
<cfelse>
<cflocation url="#ret#">
</cfif>
neither of these cflocation provide a url.return value, especially with a value of 0 or 1.
Maybe it should look more like:
<cfif #howmany# gt 0>
<cflocation url="vehicle.cfm?carID=#howmany#&return=1">
<cfelse>
<cflocation url="summary.cfm?carID=&return=0">
</cfif>
Chuck