Professional Web Applications Themes

Simple URL variable cant get working. - Coldfusion - Advanced Techniques

Hello all, Simple one for you here. I have product groups in my data base, and people click on a web generated menu passing a variable via URL to a results page simple stuff as I said. But for some reason I'm being a plonker and cant pass a variable that contains a '#' see code below. <a href="1_CusInbox.cfm?comp=PARTS&level=TOP">Parts</a> <--- works fine as you would expect. But if I try and send the variable as below, the variable on the next page ommits the # at the end of 'PARTS' <a href="1_CusInbox.cfm?comp=PARTS#&level=TOP">Parts</a> I have tried comp='PARTS#' comp=PARTS## comp=PARTS### comp='PARTS##' and ...

  1. #1

    Default Simple URL variable cant get working.

    Hello all,
    Simple one for you here.
    I have product groups in my data base, and people click on a web generated
    menu passing a variable via URL to a results page simple stuff as I said.

    But for some reason I'm being a plonker and cant pass a variable that contains
    a '#' see code below.

    <a href="1_CusInbox.cfm?comp=PARTS&level=TOP">Parts</a> <--- works fine as
    you would expect.

    But if I try and send the variable as below, the variable on the next page
    ommits the # at the end of 'PARTS'

    <a href="1_CusInbox.cfm?comp=PARTS#&level=TOP">Parts</a>

    I have tried
    comp='PARTS#'
    comp=PARTS##
    comp=PARTS###
    comp='PARTS##' and so on

    I just cant work out how to pass the # in a URL variable.

    Some of our product groups are called things like 'PARTS#' and therefore it
    would be a logistical nightmare to rename product groups and parts etc to have
    no '#' in there name so i need to just work this out.

    Im sure this is real simple but its one of them things iI seem to have tried
    every thing and still cant get working.



    Kind Regards Guy


    Hagster Guest

  2. #2

    Default Re: Simple URL variable cant get working.

    Hi,

    Have you tried it like this?

    <cfoutput>
    <a href="1_CusInbox.cfm?comp=#PARTS#&level=TOP">Parts </a>
    </cfoutput>

    Ayanmar Guest

  3. #3

    Default Re: Simple URL variable cant get working.

    Hagster wrote: 

    1_CusInbox.cfm?comp=#URLEncodedFormat('PARTS##')#& level=TOP

    --
    <mack />


    Neculai Guest

  4. #4

    Default Re: Simple URL variable cant get working.

    Yes tried that, it does not pass anything.

    You might have the wrong meaning of what I need.

    I'm not trying to resolve the variable 'Parts' and pass it through
    '#URL.comp#' im trying to send '#URL.comp#' which equals the string 'PARTS#'

    so they click on a link and on the next page if you did
    <CFOUTPUT>#URL.comp#</CFOUTPUT> you would get the sring PARTS#

    Thanks though for the reply



    Hagster Guest

  5. #5

    Default Re: Simple URL variable cant get working.

    Ooooh.............. yes, I did misunderstand. hehe.......... and I only saw now your Q's probably answered just above my post......... :)
    Ayanmar Guest

  6. #6

    Default Re: Simple URL variable cant get working.

    Ok still no good
    I tried
    1_CusInbox.cfm?comp=#URLEncodedFormat('PARTS##')#& level=TOP

    but when mouse over the link the status bar reports the variable missing the
    '#' again and on the following page the variable is an empty string see piccys
    below to clarify.


    http://www.gearboxes.com/hag/vars.gif
    And we dont even get the variable equaling 'PARTS' its completely empty.

    Any more ideas please



    Hagster Guest

  7. #7

    Default Re: Simple URL variable cant get working.

    Ok cracked it :)


    1_CusInbox.cfm?comp=<CFOUTPUT>#URLEncodedFormat('P ARTS##')#</CFOUTPUT>&level=TOP

    seems to work.

    I was forgeting there was no cfoutput tages around my table cells so placing
    one in the link encode the URL variable correctly and passes comp = 'PARTS#'

    Thanks all for you ideas and fix.

    Hagster Guest

Similar Threads

  1. Defining a simple variable! arg
    By Bigjjames in forum Macromedia ColdFusion
    Replies: 1
    Last Post: June 21st, 11:24 PM
  2. Replies: 5
    Last Post: September 23rd, 06:28 PM
  3. Simple question: query string variable and more
    By Adam Sowalsky in forum PHP Development
    Replies: 1
    Last Post: August 15th, 08:40 PM
  4. Simple variable question.
    By Dave Anderson in forum ASP
    Replies: 1
    Last Post: July 18th, 12:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139