This is a discussion on "urgent advise needed please, username and password" within the Databases section. This forum, and the thread "urgent advise needed please, username and password are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
urgent advise needed please, username and password
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
urgent advise needed please, username and password
Hi I am new to databases, I am looking to install a member log in script, I have the username and password added to the database and the php files are uploaded to my server, however when the log in box appears and I enter the username and password I set up in the database it says username and password incorrect.
Here is the php code, if someone could advice me of what parts to change, that would be much appreciated. config1.php
Marie Last edited by karinne; Jun 6th, 2007 at 14:45. Reason: Please use [php]...[/php] tags when displaying PHP code! |
|
|
|
|||
|
Re: urgent advise needed please, username and password
Hi, thank you for your reply
I created the database and assigned a username and password, is that what you mean? |
|
||||
|
Re: urgent advise needed please, username and password
Not really ... the second chunk of code you pasted refers to a login_table
so ... you need to create that table in your database (if it's not created already) and put a username and password in that table. |
|
|||
|
Re: urgent advise needed please, username and password
Hi, I have created a table but I'm not sure how to assign a username and password to it ?
Also I keep getting the error, error could not connect. I think I may be entering the wrong username and password. For example purposes If my username to log into my cpanel was waterbridge and the password to log into my cpanel was dispenser and my databases was called learn. This is how I would have the config.php, is that wrong?
Marie Last edited by karinne; Jun 7th, 2007 at 01:23. Reason: Reason: Please use [php]...[/php] tags when displaying PHP code! |
|
||||
|
Re: urgent advise needed please, username and password
That looks ok to me.
Check with your host ... maybe it's not localhost you have to use?! And are you sure your username and password to login in your db is the same as your cpanel? |
|
|||
|
Re: urgent advise needed please, username and password
Looks fine to me. Probably is a problem with you not being on localhost like karinne says.
Just thinking though.... shouldn't $dbtable be the database name instead? because it's using it to connect to the database. I would think it should be
|
|
||||
|
Re: urgent advise needed please, username and password
You appear to be confusing the login name/address for your server host with the login name/address for your database. They are two different animals. (The username and password you need is not for the table, but for the specific database. )
If you haven't done this already, go to cpanel and navigate to the "MySQL databases". That will give you a fairly intuitive GUI where you will: 1) set up a couple of usernames and passwords, maybe name one username "admin" and one "user" or something easy to remember. Write them down on a piece of paper. 2) Then, add the usernames to the database with specified permissions. You want one username (e.g. xxxxx_user) to use for the general public, with extremely limited permissions, and another private one (e.g. xxxxx_admin) if you want add/modify/delete permissions from php. 3) Once you have added the username(s) to the database, the MySQL Databases function will actually give you a pattern path for php! My strong hunch is that "localhost" is correct, since it seems your database and webpage are on the same server. Finally, make sure that the path in your PHP connection script is correct. I ALWAYS put the connection script in the root directory -- this is very important. You do not, under any circumstances, want the public to see the "public" username/password. You have a directory, most frequently named "/public_html/", where you put files you want to access from the internet. This is whatever directory your index.html or index.php page goes into. Put your database access file higher than this "public_html" or whatever directory. That way, your php scripts will be able to access it, but it can't be accessed from the web. So on your pages, you would have something like
Last edited by masonbarge; Jun 7th, 2007 at 12:59. |
![]() |
| Tags |
| error |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Urgent Help Needed! | dhossai | Databases | 6 | Oct 28th, 2007 02:30 |
| Need help with Username and Password database.!asap | tcpodg | PHP Forum | 8 | Sep 26th, 2007 14:12 |
| Very urgent help needed | gotmad | PHP Forum | 2 | Sep 19th, 2007 14:45 |
| Username & Password | robukni | PHP Forum | 13 | Apr 4th, 2007 22:36 |
| what is default sqlserver username & password ? | clickme_not | Databases | 1 | Aug 27th, 2006 17:57 |