This is probably a messy solution and may have some side effects I'm not
aware of.

make your url www.domain.com/index.cfm?& regardless and then add on the
modified CGI.QUERY_STRING using Replace(CGI.QString, "render=1", "")

You'll end up with www.domain.com/index.cfm?&somevar=1&someothervar=2 but
then that might be ok, seems to work anyway. Does anyone know if this has
any ill effects?

Ade

-----Original Message-----
From: Lovelock, Richard J [mailto:[EMAIL PROTECTED]
Sent: 11 November 2003 13:02
To: 'cflist'
Subject: [ cf-dev ] CGI Variables Part II


Hi guys
 
Following on from the CGI variable/Printer Friendly Page link issue...I have
that link resolved now thank you very much 
 
However, on the Printer Friendly Page - there is a link "Back to Web
Version" which needs to basically take the URL and take off the
Renderforprint=1 parameter from the end of the URL BUT I need to check
whether there are other URL parameters and if there are - keep them intact
(but still chop the renderforprint=1 off)
 
i have put the following code together - no doubt there may be a similar way
to do it - but it seems to work:
 
 
<cfif #ListLen(CGI.QUERY_STRING, CHR(38))# GT 1 >
  <cfset qlength = #ListLen(CGI.QUERY_STRING, CHR(38))# - 1 >
  <cfset newquerystring = "">
  <cfloop from="1" to="#qlength#" index="ind">
     <Cfset newquerystring = ListAppend(newquerystring,
#ListGetAt(CGI.QUERY_STRING, ind, chr(38))#, chr(38))>
  </cfloop>
<cfelse>
  <cfset newquerystring = #cgi.script_name#  
</cfif>
 
i.e.
- check if there is more than 1 URL var (there will always be
?renderforprint=1 on this page)
-  if yes, set a variable = to 1 less than total number of URL vars
- set new empty var
- loop from 1 to the number of URL vars less 1, each time appending each of
the URL vars as a & delimitted list
 
- else if only 1 var, it will be renderforprint=1, so set link = to
cgi.script_name
 
 
Does all of this make sense??? 
 
 
Potentially could have used Javascript hitory -1 I suppose but being
government site accessibility is v.important
        

_______________________________________________________<?xml:namespace
prefix = o ns = "urn:schemas-microsoft-com:office:office" />

*  Regards, 
                Richard Lovelock 

Westminster City Council - Web Support
Cap Gemini Ernst & Young
Southbank
95 Wandsworth Road
London 
SW8 2HG 

(     0870 906 7482
 
_______________________________________________________

 


=======================================================
This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst & Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, youare not authorized to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.
=======================================================


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to