Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2007



Tip: Looking for answers? Try searching our database.

passing characters in URL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
namtax - 30 Aug 2007 18:27 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.