• Hello

    Based on the mailing-list plugin which has a subscription page at the root level of the blog, I’m trying to automatically include the email of a user that is already logged-in. (As its a bother typing in an email address when you are already logged-in)
    So when the user goes to the subscribe.php page, their email is already displayed in the subscription box

    The code snippet is:


    <input class="subscribe" name="email" type="text" id="email" />

    I’ve tried adding either:
    value=”<?php echo $user_email ?>”
    or
    value=”<?php echo (the_author_email()); ?>”

    but nothing shows up.

    Any help would be appreciated – thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter snowcrash

    (@snowcrash)

    In case anyone else finds this useful, I figured it out (I think) with help from function ref info in the docs

    Used:
    <?php global $userdata; get_currentuserinfo(); ?>

    And for

    value="<?php echo($userdata->user_email) ?>"

    Thread Starter snowcrash

    (@snowcrash)

    Hmm…after some testing, there seems to be a problem with the value (email address) being ‘remembered’ when trying to subscribe a different email address.

    Maybe a set cookie statement?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘display logged in user email in a subscription form?’ is closed to new replies.