Re: Replace()

2009-04-05 Thread Peter Boughton

(Tried sending this last night, but HoF is broken, so I'll try sending
it via the e-mail route...)

Firstly, you should be using cfqueryparam!

Always always always use cfqueryparam when you have #hashed# variables
inside queries, especially when those variables ultimately come from
the user.


Next, the reason your query is failing is because you are trying to
use a CFML function inside SQL.
CFML functions can only act on CFML variables, not on SQL
columns/variables - you need to use SQL functions for that.

See here for details of the MySQL function:
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
Note that it always does an 'all' replace - you do not need to specify
this (and cannot specify a first-only replace).

However, you should avoid doing this in the first place - since
performing this replace will prevent the index you have on your
DealerCode PK from optimising the query, which will make your
searching much slower as the table grows.

To allow the index to work properly, make sure the hyphens are
stripped from the UUIDs at insert time, so then you only need to work
on the user input. Which you should be sanitising more thoroughly than
just excluding hyphens - you want to strip everything that's not a
valid UUID character (i.e. everything not hexadecimal).

You can do this with a regular expression replace:
CFset matchDealer = reReplace(form.txtDealer,'[^0-9A-F]','','all') /

Just to point out - there are no #hashes# there - and there shouldn't
be in your original function. You only need to hash variables when you
are outputting them in a string, not when you are passing them
directly as function parameters.
( Likewise, your vDealer line can simply be: CFset vDealer= matchDealer / )


So, I think that's it. Hopefully it all makes sense and is helpful? :)

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321334
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


ColdFusion 8: CFDocument doesn't support differently sized headers for subsequent pages

2009-04-05 Thread Chris Johnson

Something that I haven't been able to find anyone else talking about, is that 
in CF8, there doesn't seem to be a way to have one header for your main page 
(with logo, address, etc.) and then a briefer header for subsequent pages (just 
page number, invoice #, etc.).

In CF7, it's done by specifying a topmargin value that's smaller than the first 
page's header, but the correct size for subsequent pages.  Then you simply pad 
(via padding-top:XXXpx) the content you're displaying so that it starts where 
the first page header ends.  


In CF8 though, using the same setup, the first page's header squishes itself to 
fit in the topmargin value.  

I suppose that's correct, but I still can't find any way to have a larger first 
page header, with smaller secondary page headers.



Does anyone know of any way to do this?  It seems to be standard practice for 
most invoicing/billing/etc., but I've yet to find a solution?


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321335
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: ColdFusion 8: CFDocument doesn't support differently sized headers for subsequent pages

2009-04-05 Thread Mike Chabot

Have you tried using the cfdocumentsection tag?

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_d-e_07.html

-Mike Chabot

On Sun, Apr 5, 2009 at 8:05 PM, Chris Johnson u...@askugg.com wrote:

 Something that I haven't been able to find anyone else talking about, is that 
 in CF8, there doesn't seem to be a way to have one header for your main page 
 (with logo, address, etc.) and then a briefer header for subsequent pages 
 (just page number, invoice #, etc.).

 In CF7, it's done by specifying a topmargin value that's smaller than the 
 first page's header, but the correct size for subsequent pages.  Then you 
 simply pad (via padding-top:XXXpx) the content you're displaying so that it 
 starts where the first page header ends.


 In CF8 though, using the same setup, the first page's header squishes itself 
 to fit in the topmargin value.

 I suppose that's correct, but I still can't find any way to have a larger 
 first page header, with smaller secondary page headers.



 Does anyone know of any way to do this?  It seems to be standard practice for 
 most invoicing/billing/etc., but I've yet to find a solutio

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321336
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4