Remove a var from URL

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Remove a var from URL

    Hey'all, I'm looking for a little hint that would be usefull for me. I
    sometimes use the technique to add a URL var to include a file, for example a
    link that goes to index.cfm?inc=page.cfm redirect to index.cfm which includes
    page.cfm... the problem is that I would like to hide this var because if the
    user refresh the page, it does the process again and i don't want the page.cfm
    to be included again (for example because it does an insert in the
    database).... so the cool thing would be to hide inc=page.cfm from the URL so
    it would work perfectly ! Is it possible ? Is it possible without making a
    redirection...for example Replace(CGI.QUERY_STRING...) and cflocation ? thanks
    in advance for your help ! antoine from belgium

    beefo Guest

  2. Similar Questions and Discussions

    1. How 2 remove url-bar etc...
      Hi u guys, I have a question for those who can help me. I want to make a popup when u click on a button but the movie that is playing within HTM...
    2. remove blanks
      Is there a func or a onliner for removing blanks from both ends? I'm using these: $username =~ s/^\s+//; $username =~ s/\s+$//; There got...
    3. pop-ups-pls help remove
      You may also download and run periodically Add-Aware. I don't remember their web site, check Google to find out. The basic version is free, If you...
    4. How to Remove 'S
      > The problem is each time I try to submit any thing that ends in 's eg St a Double up your quotes before entering them into a database... for...
    5. how to remove a programe from the add/remove list manually
      i am using winXP home, i just remove a programe from the start menu(start>>all programes>>name of the programe>>uninstall),but the programe name is...
  3. #2

    Default Re: Remove a var from URL

    Stupid me !!! I have found the answer....perhaps it s not the best way, but it
    does work !!


    Replace(Replace(CGI.QUERY_STRING,'lang=#Iif(isdefi ned('url.lang'),DE(url.lang),D
    E(''))#',''),'&&','&','ALL')

    For this example, the VAR i wanted to retrieve is url.lang

    beefo Guest

  4. #3

    Default Re: Remove a var from URL

    Sorry, it seems that it was still bugging when the var was undefined.... so
    here is the longest but safest way to do it:


    <cfif isdefined('url.lang')>
    <cfset newquerystring =
    Replace(Replace(CGI.QUERY_STRING,'lang=#Iif(isdefi ned('url.lang'),DE(url.lang),D
    E(''))#',''),'&&','&','ALL')>
    <cfelse>
    <cfset newquerystring = CGI.QUERY_STRING>
    </cfif>

    <cfoutput>#newquerystring#</cfoutput>

    beefo Guest

Posting Permissions

  • You may not post new threads
  • You may 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