[Zope] how to capture the referring URL??
Trevor Toenjes
zope@toenjes.com
Mon, 3 Sep 2001 15:28:14 -0400
> 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>