have a custom html form in page:
<form action="localhost/mail.php" id="contactForm" method="post">
<ul>
<li>
<input type="hidden" name="submitted" value="USERNAME_HERE" /></li>
<li>
<button type="submit">Send request</button>
</li>
</ul>
</form>
Can I somehow add current logged username name in to value=... ? So when user will click "Send request" button, I will receive his username in email?
Tried use [userinfo field="user_login"] and :
<?php global $current_user;
get_currentuserinfo();
echo 'Username: ' . $current_user->user_login . "
";
?>
But all php code was cut so it is useless :(
Please advise what I am doing wrong.
Thanks!