Login Extension and mySql
Posted: Sat Feb 15, 2020 5:16 pm
Hi,
I have been testing and playing with the Login extension as I want to add this functionality to my Website, I created a simple page (login) which I have added the 'Login' extension to, I have set the properties for Error Page to redirect to another i.e 'access_denied.php' and Destination Page to 'index.php'.
I have also set this up to use a mySql table (login) on my NAS Server.
I have added and configured the database to my Sql table which I have created from running the script (via the Help), which created:
Id, username, fullname, password, email, active, code, role and avatar.
I populated the table with one row of username, fullname, password, email, active and role. Code and Avatar are NULL?
Every time I enter the username and password (table username and password) in the Login box on the published page it jumps to the access_denied page?
I tested the db connection which if I change the db name in the Login extension "I get Failed to select database
Unknown database 'mySqldb'" If I change the table name I get to my access_denied.php
I changed the 'active' entry in the table from 0 to 1 as active has to be non-zero?
Not sure about $crypt_pass and md5 in the php code for the extension?
As an extra step, I added the Datviewer extension to the login page and added all the above details and it reads and displays the table ok?
So it seems the Login script is connecting to the db and table ok, but the authorisation of user/password is failing?
I wanted to add to the extension code to show the data and results of the Login query to the db, not being 'proficient' in php code has anyone any ideas? Also as soon as you hit the Login button on the Login page, it jumps to the access_denied page so any results won't have time to display anyway?
I am running version 15.0.4
Any help appreciated.
Thanks
Adrian (J)
I have been testing and playing with the Login extension as I want to add this functionality to my Website, I created a simple page (login) which I have added the 'Login' extension to, I have set the properties for Error Page to redirect to another i.e 'access_denied.php' and Destination Page to 'index.php'.
I have also set this up to use a mySql table (login) on my NAS Server.
I have added and configured the database to my Sql table which I have created from running the script (via the Help), which created:
Id, username, fullname, password, email, active, code, role and avatar.
I populated the table with one row of username, fullname, password, email, active and role. Code and Avatar are NULL?
Every time I enter the username and password (table username and password) in the Login box on the published page it jumps to the access_denied page?
I tested the db connection which if I change the db name in the Login extension "I get Failed to select database
Unknown database 'mySqldb'" If I change the table name I get to my access_denied.php
I changed the 'active' entry in the table from 0 to 1 as active has to be non-zero?
Not sure about $crypt_pass and md5 in the php code for the extension?
As an extra step, I added the Datviewer extension to the login page and added all the above details and it reads and displays the table ok?
So it seems the Login script is connecting to the db and table ok, but the authorisation of user/password is failing?
I wanted to add to the extension code to show the data and results of the Login query to the db, not being 'proficient' in php code has anyone any ideas? Also as soon as you hit the Login button on the Login page, it jumps to the access_denied page so any results won't have time to display anyway?
I am running version 15.0.4
Any help appreciated.
Thanks
Adrian (J)