-
Login script PHP
http://www.phpeasystep.com/phptu/6.html
Hello,
Could any help with understanding the code of the login script in the above link. Basically its the following section that I need to understand. I'm not entirely sure how to connect to the server and database:
<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="members"; // Table name
thanks!
-
-
$host="localhost"; is the database server for your webhost. If localhost doesnt work, it might be something like "db1.webhost.com". CHeck in your Control Panel if unsure.
$username=""; is the username you use to log into your databases/phpMyAdmin panel - it might use your accountname as a prefix, such as "matt_dbuser". This might also be the name of the database too.
$password=""; Is the password you setup when creating your database via your webhost.
$db_name="test"; is the name of the database you created with your webhost - might be the same as the "$username" value. You need to set this up before you start connection with the script in the tutorial.
Hope that helps
-
-
Connecting to MySQL should be very easy. But it's often hard because you don't know the correct information from the host. It's also hard because if you don't know this information, you can't test the code to begin to understand it.
So my suggestion is that you look up the "connect to mysql" on your host's website. They usually have examples.
Many hosts have unpredictable mysql server names, so you won't ever get it to work unless you know that.
Once you have the correct info, just fill it in like you have.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks