how to capture the referring URL??
another newbie Q... I am trying to figure out how to capture the PREVIOUS URL in a variable. It looks like I need to do something with PARENTS and absolute_url. What is the proper syntax? Thanks, -Trevor Toenjes
On Monday 03 September 2001 01:12 pm, Trevor Toenjes wrote:
another newbie Q... I am trying to figure out how to capture the PREVIOUS URL in a variable. It looks like I need to do something with PARENTS and absolute_url.
What is the proper syntax?
<dtml-var "REQUEST['HTTP_REFERER']"> oughta do it try setting up a DTML Method with this and see what other goodies are at your disposal <dtml-var REQUEST>
Thanks, -Trevor Toenjes
_______________________________________________ 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, --On Montag, 3. September 2001 14:05 +0800 bak <kedai@kedai.com.my> wrote:
On Monday 03 September 2001 01:12 pm, Trevor Toenjes wrote:
another newbie Q... I am trying to figure out how to capture the PREVIOUS URL in a variable. It looks like I need to do something with PARENTS and absolute_url.
What is the proper syntax?
<dtml-var "REQUEST['HTTP_REFERER']"> oughta do it
*warning* this is not always available and can easy be faked *warning* Regards Tino
try setting up a DTML Method with this and see what other goodies are at your disposal
<dtml-var REQUEST>
Thanks, -Trevor Toenjes
_______________________________________________ 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 )
_______________________________________________ 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 )
another newbie Q... I am trying to figure out how to capture the PREVIOUS URL in a variable. It looks like I need to do something with PARENTS and absolute_url.
What is the proper syntax?
<dtml-var "REQUEST['HTTP_REFERER']"> oughta do it try setting up a DTML Method with this and see what other goodies are at your disposal
<dtml-var REQUEST>
*warning* this is not always available and can easy be faked *warning* Regards Tino
Tino, thanks for the warning, but could you clarify what you mean by faked. Do you have another way that can't be faked? Thanks for the help, Trevor
I dont know if this clarification makes a difference to the solution. But I am trying to add new useful functionality to your boring "tell-a-friend" form. http://www.zope.org/Members/BwanaZulia/tell_a_friend/screenshot_1 GOAL: Include choices (*) Send the Full Page (*) Just send link Automatically include the multi-part mime (HTML and/or URL) of the page that the user wants to send, rather than the typical "dumb" blank form. The "Email_This_Page" method is in standard_html_header, so that it is on every page. Thanks again for the help, Trevor
Tino, thanks for the warning, but could you clarify what you mean by faked. Do you have another way that can't be faked?
Don't use referring url ;-) Seriously, it depends of your problem, but it may be solved by using some kind of user sessions... wild guess I admit If you could explain more your problem, maybe someone could find another solution? Philippe
Don't use referring url ;-) Seriously, it depends of your problem, but it may be solved by using some kind of user sessions...
If you could explain more your problem, maybe someone could find another solution?
Here is a shot at what I am working on. This is an "Email to a Friend" thing. Thanks to anyone that can get me in the right direction. And explain why I shouldnt use HTTP_REFERER. ### dtml-method>'Form to collect the email and comments' *using Formulator ### ***NOTE: line 2 captures the referring URL in 'emailthisURL' **** ### POST to the method below. ### <dtml-var "form.header()"> <input type=hidden name="emailthisURL" value="<dtml-var "REQUEST['HTTP_REFERER']">"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td>Friend's Email</td> <td> <dtml-var "form.email.render_from_request(REQUEST)"><dtml-var requiredmark> </td> </tr> <tr> <td valign="top"> <br>Web Page URL that will be sent: </td> <td><dtml-var "REQUEST['HTTP_REFERER']"></td> </tr> <tr> <td valign="top"> <br>Comments: <dtml-var requiredmark> </td> <td><dtml-var "form.comments.render_from_request(REQUEST)"></td> </tr> </table> <input type="submit" value="Submit Question"> <dtml-var "form.footer()"> ### dtml-method>>>'Process the form data' --assume the client accepts HTML email for now. ### sends an HTML email with the page in the email ### ***NOTE: emailthisURL only prints its address, not its contents. ### <dtml-sendmail smtphost="localhost"> From: email@address.com(URGENT) To: <dtmal-var email> Subject: Here is a page to reference. <dtml-mime type=text/html> <dtml-var comments> <dtml-var emailthisURL> !--this includes the URL but doesn't display it in HTML, my guess is that this is a string that needs to be converted to some kind of referring object--! </dtml-mime> </dtml-sendmail>
participants (4)
-
bak -
Philippe Jadin -
Tino Wildenhain -
Trevor Toenjes