Forum Moderators: coopster
I think I've figured out I can use http referer but I don't know how to reference it in my form. Any ideas?
What scripting language does your form processor use?
For php I would use the $HTTP_REFERRER. You have to keep in mind that you may not always get a referrer from every browser. You could also pass it to the form. Put it in the form link on the page. You would have to script that as well. You could have a link like.
www.somedomain.com/feedback.html?page=article12
Something like that, but the actual implementation would have to do with what language you are using or have available.
Presuming it's PHP, you could do something like this:
On the original page
<a href="feedback.php?page=<?=$PHP_SELF?>">Comment on this page</a>
At the top of feedback page after they've filled in their comments (must be above all HTML and white space).
<?
if (isset($submit)) {
$comments = $_POST['comments'];
$comments .= "\n\nSent about the page $page";
mail ("me@example.com", "Subject", $comments);
header ("location: $page?sent=yes");
}
?>