Simple PHP Phonebook - Printable Version +- Yealink Forums (http://forum.yealink.com/forum) +-- Forum: IP Phone Series (/forumdisplay.php?fid=4) +--- Forum: General topics (/forumdisplay.php?fid=15) +--- Thread: Simple PHP Phonebook (/showthread.php?tid=1165) |
RE: Simple PHP Phonebook - jaykay - 03-02-2015 06:25 PM (03-02-2015 01:08 AM)jaykay Wrote:OK. I am trying to set up the phonebook but am missing something. My knowledge of MySql wouldn't be too good.(02-28-2015 05:14 PM)WelshPaul Wrote:(02-28-2015 04:57 AM)jaykay Wrote:(02-28-2015 04:07 AM)WelshPaul Wrote: I'm confused... Are you talking about updating the XMl file in phonebook script posted above? or your own XML file that your hosting on your web server? I downloaded your files to my htdocs folder on webserver. I have created a new database on sql and named it "yealink". I have then imported phonebook_sql.sql. I then create a new user with a password for that newly created db. When I then browse to localhost/phonebook I get a login page but an error when entering any username or password. Any ideas? RE: Simple PHP Phonebook - cptjack - 03-03-2015 03:37 AM (03-02-2015 06:25 PM)jaykay Wrote: Any ideas? Did you change the server, username, password and database names in the following line of file data\datalogin.php: PHP Code: $con=mysqli_connect("localhost","root","password","phonebook"); If these are correct, please verify that you can logon with the commandline, using the parameters: Code: mysql -h <server> -u <username> -D <database> -p RE: Simple PHP Phonebook - jaykay - 03-03-2015 04:08 AM (03-03-2015 03:37 AM)cptjack Wrote:Hi cptjack(03-02-2015 06:25 PM)jaykay Wrote: Any ideas? I made the change and that has pushed me on a little bit. It looks like I need to alter the login.php file also. I see there are a lot of entries in this file with regard to username and password. Do you know which line I have to enter my username/password details? I now have this error: Notice: Undefined variable: error in C:\xampp\htdocs\phonebook\phonebook\login.php on line 75 Many Thanks JK RE: Simple PHP Phonebook - cptjack - 03-03-2015 05:04 AM That's a non critical error, you should be able to login with a user now. The username and password in login.php are checked against the user table in the 'yealink' database. To avoid the error message, the $error variable needs to be declared at the top of the script are non-critical errors should be suppressed. RE: Simple PHP Phonebook - jaykay - 03-03-2015 05:29 AM (03-03-2015 05:04 AM)cptjack Wrote: That's a non critical error, you should be able to login with a user now. The username and password in login.php are checked against the user table in the 'yealink' database. I have 2 users in the db. One is the default user/user. The other is custom test/test. When I use either username I get "incorrect password". When I use something random or root as username I get "incorrect username". So it looks like it is recognising the username user or test from the db but accepting the password. RE: Simple PHP Phonebook - cptjack - 03-04-2015 06:17 AM Make sure to md5() your passwords with: Code: update users set password=md5('user') where username='user'; This should give you the passwords 'ee11cbb19052e40b07aac0ca060c23ee' and '098f6bcd4621d373cade4e832627b4f6' respectively. RE: Simple PHP Phonebook - jaykay - 03-04-2015 08:46 PM (03-04-2015 06:17 AM)cptjack Wrote: Make sure to md5() your passwords with: Meant to post yesterday. I created a new db and imported the .sql file. I made changes as per afore mentioned and I can now browse to the db with user/user. Thanks for your help. |