School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,513 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,947 people online right now. Registration is fast and FREE... Join Now!




Element BROCHURE is undefined in URL.

 

Element BROCHURE is undefined in URL., Error message

ddrumm

24 Mar, 2009 - 01:29 AM
Post #1

New D.I.C Head
*

Joined: 24 Feb, 2009
Posts: 23


My Contributions
Hi folks
im getting the below error message when i try and display the website, and cant figure out what the problem is
Element BROCHURE is undefined in URL.

Heres the code if it helps

CODE
[/b]<CFQUERY NAME="qupdate" DATASOURCE="#request.dsn#">
    SELECT *
    FROM BROCHURE, BROCHURESIZE
    where BROCHURE_ItemID = #url.brochure#
</CFQUERY>


<form method="post" action = "results.cfm">
<cfif isdefined("url.brochure")>
<input type="hidden" name="BROCHURE_ItemID" value="#url.brochure#">
<input type="hidden" name="BROCHURESIZE_Key" value="#url.brochure#">

</cfif>

<cfif isdefined("form.BROCHURE_ItemID")>
<!--- this is an update --->
<cfquery name="qupdate" datasource="#request.dsn#">
update BROCHURE, BROCHURESIZE
set DIVISIONS_Key = #form.DIVISIONS_Key#,
BROCHURESIZE_Key = '#form.BROCHURESIZE_Key#',
BROCHURE_Title = '#form.BROCHURE_Title#',
BROCHURE_Detail = '#form.BROCHURE_Detail#'
BROCHURESIZE_Name = '#form.BROCHURESIZE_Name#'
where BROCHURE_ItemID = #form.BROCHURE_ItemID#
</cfquery>
<cfelse>
<!--- this is an insert --->
<cfquery name="qupdate" datasource="#request.dsn#">
insert into BROCHURE, BROCHURESIZE
(DIVISIONS_Key,BROCHURE_Size,BROCHURE_Title,BROCHURE_Detail,)
values
(#form.DIVISIONS_Key#,'#form.BROCHURE_Title#','#form.BROCHURE_Detail#','#form.BROCHURESIZE_Name#')
</cfquery>
</cfif>
<cflocation url="index.cfm"> [b]


User is offlineProfile CardPM
+Quote Post


CR250

RE: Element BROCHURE Is Undefined In URL.

24 Mar, 2009 - 05:55 AM
Post #2

D.I.C Head
**

Joined: 14 Jun, 2008
Posts: 54



Thanked: 2 times
My Contributions
For starters please use <cfqueryparam /> especially for URL, post parameters but really everywhere.

As for your issue dump url and make sure its appearing correctly.
User is offlineProfile CardPM
+Quote Post

xheartonfire43x

RE: Element BROCHURE Is Undefined In URL.

24 Mar, 2009 - 06:38 AM
Post #3

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 260



Thanked: 2 times
My Contributions
The error is being called from you query most likely which doesn't check whether or now url.brochure is defined. So either put a <cfif isDefined('url.brochure')> or put <cfparam name="url.brochure" default="whatever brochure you want as the default">.
User is offlineProfile CardPM
+Quote Post

ddrumm

RE: Element BROCHURE Is Undefined In URL.

30 Mar, 2009 - 02:26 AM
Post #4

New D.I.C Head
*

Joined: 24 Feb, 2009
Posts: 23


My Contributions
QUOTE(xheartonfire43x @ 24 Mar, 2009 - 06:38 AM) *

The error is being called from you query most likely which doesn't check whether or now url.brochure is defined. So either put a <cfif isDefined('url.brochure')> or put <cfparam name="url.brochure" default="whatever brochure you want as the default">.



Cheers Thanks for that icon_up.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 05:18AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month