add new field in login page

Hello Siri want to ask for add new field in login pagei try to add new database example "login_school"table name like this :

  1. idlogin_school
  2. choose_level

content in table like this

  1. idlogin_school : 001
  2. choose level :
  3. parent
  4. student

the question is :how to add new field in login form (dropdown)username :password :*select login as : show dropdown like (parent or student) << new field in login formfield captcha :button login==================so this way I do that the parent and student users have different database tables (not combined)how to add the new field with dropdown select sir?thanks before

The best and recomended way is to add it by jQuery in Startup Script of login page . for example here am adding a drop down with two options under the password filed, paste this in client scripts->other->login page->stratup script//Add a drop down under password filed
$(“#password”).parent().parent().append(‘

Select One option 1option 2
’);NOTE: you can see the vlaue using the $_POST php array at server side, execpt you must handle the validation on your ownOtherwise if you really insist, you can customize the login.php in the template file “phpv20180.php”. but everytime phpmaker send an update you will have to make the same chnages to any new template it send which is not worth it
Read help file topic: “Customizing Template” for your information.

thanks for your replyit’s work for create dropdown in login pagebut, i’m confused connect to database in dropdownI mean is there any additional code to connect the dropdown with phpmaker?or can use ordinary database connection code?

creat015 wrote:
so this way I do that the parent and student users have different database tables
(not combined)I would assume that you want to separate user table.
It’s a bad move since security table can only use 1 table.You can assign a level (parent or student) to a username.
This way when user logged-in the apps already knew whether the user either a parent or a student and assign the appropriate privileges to them.
Within the context, user level (parent or student) can only be decided AFTER login, not before.

Good Day all. Sorry for bumping an ancient thread but I need assistance with this also. I am not able to see my value via $_POST anywhere. I’ve tried var_dump($_POST); die(); in several locations (User_LoggingIn etc) and it only returns token, modal, username and password. What is the correct server event to capture my custom field on the login page in? Thanks.

I sorted it out. I’ve gotten so used to rsnew and rsold i forgot POST uses name attribute and not id which unfortunately the above jquery example didn’t have. After that I was able to capture the field in User_Loggingin. Thanks.