WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
Can i add referrer features ? (3 posts)

  1. mishals
    Member
    Posted 3 years ago #

    Hi all
    can i added ( referrer ) for form ?
    i have holidays blog & i want see from which page this visitor send email

    Regards ;)

  2. yope
    Member
    Posted 3 years ago #

    I want to do that as well.

    In a normal php file I would use this code to find the address of the page the user has sent the mail from:

    <?php
    function curPageURL() {
    $isHTTPS = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on");
    $port = (isset($_SERVER["SERVER_PORT"]) && ((!$isHTTPS && $_SERVER["SERVER_PORT"] != "80") || ($isHTTPS && $_SERVER["SERVER_PORT"] != "443")));
    $port = ($port) ? ':'.$_SERVER["SERVER_PORT"] : '';
    $url = ($isHTTPS ? 'https://' : 'http://').$_SERVER["SERVER_NAME"].$port.$_SERVER["REQUEST_URI"];
    return $url;
    }
    ?>

    And I'll use a hidden field to send the value:
    <input name="url" type="hidden" value="<?php echo curPageURL(); ?>" />

    The question is how to integrate that with the plugin?
    when i echo that as part of the template it works but when i try to use it as a value (text) in the form it just sends me the php field itself "<?php echo curPageURL(); ?>"

    Thanks!!!!!

  3. yope
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic