Redirecting to url with query information
Hi, i am trying to redirect a request back to its origin-url after a user authentication using the response.redirect mechanism providing it with the url via http_referer. This works well unless the origin-url has a query section appended (e.g. http://www.xxx.yy/origin/url?id=007). Anybody has experienced the same and found a way how to solve that? No need to say that this query string is essential and it can't be omitted. TIA, Michael -- ----------------------------------------------------------- Michael Schulz in medias res Dipl.-Geologe Gesellschaft für Informationstechnologie mbH Sautierstr. 38, 79104 Freiburg 0761 55695-95 (Fax 96) mschulz@webgis.de www.webgis.de
you can use: <dtml-var PATH_INFO> or <dtml-var URL> or <dtml-var SERVER_URL> or <dtml-var PATH_TRANSLATED> or <dtml-var BASE1> or <dtml-var BASE2> for the script: value="<dtml-var SCRIPT_NAME><dtml-var PATH_INFO><dtml-if QUERY_STRING>?<dtml-var QUERY_STRING></dtml-if>" hopefully this helps. Fritz Mesedilla Systems Administrator Summit Interactive, Inc. FHM | Seventeen | Candy | Cosmopolitan | Preview | Good Housekeeping femalenetwork.com | candymag.com | fhm.com.ph | cosmo.com.ph Palm Pilot Software: TVSked - Download from the link below ---------------------------------------------------------------------------- http://mesedilla.tripod.com +Basta Ikaw Lord -----Original Message----- From: Michael Schulz [mailto:mschulz@webgis.de] Sent: Thursday, September 13, 2001 11:52 PM To: zope@zope.org Subject: [Zope] Redirecting to url with query information Hi, i am trying to redirect a request back to its origin-url after a user authentication using the response.redirect mechanism providing it with the url via http_referer. This works well unless the origin-url has a query section appended (e.g. http://www.xxx.yy/origin/url?id=007). Anybody has experienced the same and found a way how to solve that? No need to say that this query string is essential and it can't be omitted. TIA, Michael -- ----------------------------------------------------------- Michael Schulz in medias res Dipl.-Geologe Gesellschaft für Informationstechnologie mbH Sautierstr. 38, 79104 Freiburg 0761 55695-95 (Fax 96) mschulz@webgis.de www.webgis.de _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Michael, --On Donnerstag, 13. September 2001 17:51 +0200 Michael Schulz <mschulz@webgis.de> wrote:
Hi,
i am trying to redirect a request back to its origin-url after a user authentication using the response.redirect mechanism providing it with the url via http_referer.
This works well unless the origin-url has a query section appended (e.g. http://www.xxx.yy/origin/url?id=007).
Anybody has experienced the same and found a way how to solve that? No need to say that this query string is essential and it can't be omitted.
if you have always this query string (and no other form variables) and you want to pass it unchanged, you can use the QUERY_STRING attribute of REQUEST. In your example it would be "id=007" HTH Tino Wildenhain
TIA, Michael
-- ----------------------------------------------------------- Michael Schulz in medias res Dipl.-Geologe Gesellschaft für Informationstechnologie mbH Sautierstr. 38, 79104 Freiburg 0761 55695-95 (Fax 96) mschulz@webgis.de www.webgis.de
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Michael Schulz writes:
i am trying to redirect a request back to its origin-url after a user authentication using the response.redirect mechanism providing it with the url via http_referer. You know that "HTTP_REFERER" is unreliable (often not there, sometimes faked)?
Pass the required information into the user authentication.
This works well unless the origin-url has a query section appended (e.g. http://www.xxx.yy/origin/url?id=007).
Anybody has experienced the same and found a way how to solve that? No need to say that this query string is essential and it can't be omitted.
Do not use "HTTP_REFERER" but remember URL and QUERY_STRING yourself. Then, perform: <dtml-call "RESPONSE.redirect(RememberedURL+'?'+RememberedQueryString)"> will work for all GET requests. Dieter
participants (4)
-
Dieter Maurer -
Fritz Mesedilla -
Michael Schulz -
Tino Wildenhain