Hi all
Was just wondering if there is any way of getting past passing specific
characters in the URL..
On my music website I have found that if a song has # or & or ( or ' in the
title, the link will not work...
for example if you navigate to the release named funeral on the link below,
and click any song with the # symbol in the title it wont work..
heres the link http://www.musicexplained.net/a/home.cfm?a=arcade+fire
many thanks
cf_dev2 - 30 Aug 2007 19:03 GMT
You should use URLEncodedFormat() to properly encode the variables in the link
> WHERE song_sng.id_sng=#id_sng.id_sng#
The error seems to occur on this line. If #id_sng.id_sng# is a string, you
should use single quotes around the value or use cfqueryparam
WHERE song_sng.id_sng= '#id_sng.id_sng#'
namtax - 31 Aug 2007 17:28 GMT
hi there...
when i use URLEncodedFormat() to encode the variables in the link, i get an
error message on the page...
and when i use single quotes around the value, the page shows, but theres no
info on the page...
if you click on any song under record "funeral"...with # in the title, you
will see that no info appears on the page..
http://www.musicexplained.net/a/home.cfm?a=arcade+fire
cheers
cf_dev2 - 31 Aug 2007 17:52 GMT
> i get an error message on the page...
What is the error message? It works fine with a title like "Neighborhood #1
(tunnels)".
> the page shows, but theres no info on the page...
That's probably because you're not using URLEncodedFormat. Parameter values
(with # signs, spaces, etc) may not be pass correctly if they aren't properly
encoded.
In any case a better method is to pass the song id, not the title. For
example, if your table contains two columns:
SongID , SongTitle
22, Neighborhood #1 (tunnels)
You should pass the ID (22) as url parameter.
namtax - 31 Aug 2007 18:10 GMT
ok...just on my way out, thanks for this, will have a go and get back to you...
namtax - 19 Sep 2007 19:36 GMT
worked like an absolute charm...
brilliant