Page 1 of 1

Login Name as a Form field

Posted: Thu Jul 16, 2020 8:35 am
by miguelss
Hi everybody,

I just play with the "login" functions, and is awesome!! Congrats for this easy way to implement a Login on a website!
But, it is possible to use the "login name" (after log in) into a form? I want to create a simple form, but as the user is already logged, I want to use his/her credentials as part of a field (hidden field or other). It is possible? Thanks in advance!!!

Re: Login Name as a Form field

Posted: Thu Jul 16, 2020 8:56 am
by Pablo
The username is stored in a session variable

Code: Select all

$_SESSION['username']
So, you can use this somewhere else in the website.

Re: Login Name as a Form field

Posted: Thu Jul 16, 2020 4:47 pm
by miguelss
That’s great Pablo!!
But sorry to ask...how can I add the username to a form? With hidden field? Could you put a small example?

Thanks in advance!

Re: Login Name as a Form field

Posted: Thu Jul 16, 2020 5:17 pm
by Pablo
I cannot teach you how to implement custom code.
But you can try this in a hidden field:

Code: Select all

<?php echo $_SESSION['username']; ?>

Re: Login Name as a Form field

Posted: Thu Jul 16, 2020 7:22 pm
by miguelss
Thanks a lot Pablo!

It works perfectly!! You are awesome!
Have a nice day!

Re: Login Name as a Form field

Posted: Thu Dec 01, 2022 2:01 pm
by amir2314
Pablo wrote: Thu Jul 16, 2020 5:17 pm I cannot teach you how to implement custom code.
But you can try this in a hidden field:

Code: Select all

<?php echo $_SESSION['username']; ?>
put this code to the editbox on Value Field ? ls this your mean ?

Re: Login Name as a Form field

Posted: Thu Dec 01, 2022 3:51 pm
by Pablo
You can the code in a hidden field (in the hidden fields properties of the form)

Re: Login Name as a Form field

Posted: Thu Dec 01, 2022 3:59 pm
by amir2314
Pablo wrote: Thu Dec 01, 2022 3:51 pm You can the code in a hidden field (in the hidden fields properties of the form)
Thanks dear pablo