Login Name as a Form field

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
User avatar
miguelss
 
 
Posts: 135
Joined: Thu Aug 15, 2013 12:25 pm
Location: Madrid, Spain

Login Name as a Form field

Post 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!!!
User avatar
Pablo
 
Posts: 21574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Name as a Form field

Post 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.
User avatar
miguelss
 
 
Posts: 135
Joined: Thu Aug 15, 2013 12:25 pm
Location: Madrid, Spain

Re: Login Name as a Form field

Post 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!
User avatar
Pablo
 
Posts: 21574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Name as a Form field

Post 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']; ?>
User avatar
miguelss
 
 
Posts: 135
Joined: Thu Aug 15, 2013 12:25 pm
Location: Madrid, Spain

Re: Login Name as a Form field

Post by miguelss »

Thanks a lot Pablo!

It works perfectly!! You are awesome!
Have a nice day!
User avatar
amir2314
 
 
Posts: 318
Joined: Wed Aug 02, 2017 12:16 pm

Re: Login Name as a Form field

Post 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 ?
User avatar
Pablo
 
Posts: 21574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Name as a Form field

Post by Pablo »

You can the code in a hidden field (in the hidden fields properties of the form)
User avatar
amir2314
 
 
Posts: 318
Joined: Wed Aug 02, 2017 12:16 pm

Re: Login Name as a Form field

Post 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
Post Reply