FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How can I create a User account and password for my website?





jcvincent
how can i create a username and password for my website using php and mysql?

thanks.
TomS
This question can bes specified...

-Wanna protect a site from public area (e.g. for an adminpanel)?
-Wanna have a VIP-Area for few people?
-Wanna create a community with many users?

The first and the second one can be made with .htaccess
For the third you need SQL.

What do you know about php and sql?
With these information it will be easy to help you Wink
jcvincent
I'm in the process of learning how to connect php and mysql.
TomS
At first you need a database and a table within it.
Log in to PhpMyAdmin and create a new database and a new table.
{db} is the name of your database,
{table} is the name of your table. Replace this variables with the name you choose. E.g. "MyDB" and "passwords".

Then you have to create several fields.

ID, Username, Password, for each additional information one field more (e.g. email, signature or something like that)

Now you can close PhpMyAdmin.
TomS
Now we use php to get access to the database.

Code:

mysql_connect("jcvincent.frihost.net", "username","password"); //Connect to the Database

mysql_select_db("{table}"); //Select our Table


This is the standardcontent.
TomS
Now we check out the login-form.

You need the following html-code:

Code:
<form action="login.php" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="login"></form>


Then we need the file "login.php" there we write the content from above (with the sql-connection)

(The rest is coming soon, (gotta look for myself, how I did it). Could become a good tutorial, don't ya think so? )
jcvincent
Thanks about these codes sir. but. that's not my problem anymore. this is my new problem.


Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in c:\apache\htdocs\good\deletedata.php on line 7

Could not connect to database because: Client does not support authentication protocol requested by server; consider upgrading MySQL client

What can I do with this problem?

Thank you very much!
Related topics
How To : Secure Your PHP Website
751 Useful Windows XP Files
password protecting a directory
Create Usernames: User Account to DB vs. TABLES vs. CELL
PhpNuke Installation Tutorial
NTOSKRNL.EXE Missing
User FTP to WebSite
what happens when I deactivate the user account security ?
my sql create user problem
how to create an account on your own webpage etc
Enable Wireless Connection for Limited User account???
can we change a db user's password or rights?
how to lock a folder in windows XP
How to password protect a zip file
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.