PDA

View Full Version : Sending a form on a custom page in vB5


Orly
03-26-2018, 07:23 AM
Hello,

I've got a quick little question.

I've added a "New Page" and on that new page I'd like to have a form which users can fill out and that will be sent to my email account. The only problem I have is that I need to know the username of the user who sent me the email. So the username should be inside that email as well. Is there an "easy" way to do this?
If not, I guess they will have to fill out their username manually in the form (which I'd like to avoid).

Thank you very much in advance!

-O

delicjous
03-27-2018, 03:54 AM
What code is your form? Is it html in a static-html-module (could not get the username) or php in a php-module? (in php you get the username by vB5_User::get('username'))

Orly
03-27-2018, 07:49 AM
Thank you! I tried it out. The PHP code works perfectly in a php-module.

Unfortunately, the email form I created is HTML + Java and if I add this code to a php-module, it doesn't work properly.
Is there a way to display the user's username in an email sent via a email form in a module?

Sorry, I know my way around HTML, but PHP is still a little new to me.

delicjous
03-27-2018, 08:56 AM
You could create your own widget and put your form in it.
to get the users username you could use:

{vb:raw user.username}