Login code information.

0 votes
asked by
edited by

I forgot to put in my email address to get my answer. Sorry about that.

Anyway, here it is again. On line 3 above in the "login.php", you point to checklogin.php, however, you state in the next code to build a "logincheck.php". Took me a minute on that one. Got it though. Now, after researching for a while, I find that my database is on a different server than localhost, so after that, I find the code to use to connect to the database in 1and1.com is the following:

//ENTER YOUR DATABASE CONNECTION INFO BELOW:
$hostname="db1111111111.db.1and1.com";
$database="db1111111111";
$username="dbo111111111";
$password="myPassword";

Of course, I have to insert my host name, database name, username and password as in the database on the server. However, when I do this and use your code from "// Connect to server and select database" down, I keep getting "Wrong username or password". When I use the code that 1and1.com gave me to connect to the database (all it does is connects), then no matter what id or password I use, it comes back and tells me I've connected.

Can you help?

1 Answer

0 votes
No avatar answered by (193k points)
edited by

If you have problems with connection to the database, then I recommend you log in to the CPanel provided by your hosting company. Once you are in the CPanel administration area, go to MySQL settings and define the database username, password, database schema, etc. You will need to use the localhost as hostname. However, the best way is to open a ticket on the hoster's support page. Explain them that despite all of your efforts, the database gives an error. This could also be a problem on their side and the fix can only be done by the website's administrators.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...