[Plugin: Contact Form 7] Add custom field management
-
I want to add the possibility to include in the e-mail the PAGE URL where the form was sent.
i made a php function that construct this url and tried to insert it in the classes.php in the same way the tag remore_IP is integrated… but i obtain ever EMPTY FIELD in the e-mail. i show you my code:
// Special [wpcf7.remote_ip] tag if ( 'wpcf7.remote_ip' == $matches[1] ) { return preg_replace( '/[^0-9a-f.:, ]/', '', $_SERVER['REMOTE_ADDR'] ); } // Special [wpcf7.page_url] tag if ( 'wpcf7.page_url' == $matches[1] ) { $pageURL = ‘http’; if ($_SERVER["HTTPS"] == “on”) {$pageURL .= 's';} $pageURL .= '://'; if ($_SERVER["SERVER_PORT"] != '80') { $pageURL .= $_SERVER["SERVER_NAME"].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return preg_replace( '/[^0-9a-f.:, ]/', '', $pageURL ); } return $matches[0];
note, $pageURL is the right value. i get empty value in the mail also replacin it with a fixed string eg. “TEST URL”.
why??
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘[Plugin: Contact Form 7] Add custom field management’ is closed to new replies.