[Plugin: Contact Form 7] Trick to include PHP in the form fields?
-
I’ve tried doing this, but with no success, so I thought I’d see if anyone else knows how to do it.
Basically I want to include PHP as the value within some of the form fields so that I can pre-fill information, like the user’s name and e-mail when they are logged in to my site.
I tried this: [text text-411 "<?php if ( is_user_logged_in() ) { ?><?php global $current_user; get_currentuserinfo(); echo $current_user->user_email; ?><?php } ?>"]
But the form showed all the PHP code there and not my e-mail. I also had the Exec PHP plugin turned on so that PHP should run in pages/posts.
Any ideas on how to make this work? Thanks so much in advance!
-Adam
- The topic ‘[Plugin: Contact Form 7] Trick to include PHP in the form fields?’ is closed to new replies.