add current page url tag to content form 7
<?php
/*
* add this to your theme's functions.php file
*/
wpcf7_add_shortcode('sourceurl', 'wpcf7_sourceurl_shortcode_handler', true);
function wpcf7_sourceurl_shortcode_handler($tag) {
if (!is_array($tag)) return '';
$name = $tag['name'];
if (empty($name)) return '';
$html = '<input type="hidden" name="' . $name . '" value="http://' . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] . '" />';
return $html;
}
/*
* open your contact form and in the form part add:
"[sourceurl thesource]"
*
* and in the email part add:
"Source URL: <a href="[thesource]">[thesource]</a><br />"
*/
and you are done