priteshgupta
Oct 28 2008, 07:43 AM
| | I want to make a login system using Mysql. I am amateur in these things so please explain in detail like spoon feeding. I have already made a database in http://www.sitebooth.com now what type of table I should make and and the website or PHP for it . If you think i hav chosen wrong site please give any better database hosting site. Please help me
Best Regards Pritesh Gupta |
Comment/Reply (w/o sign-up)
wutske
Oct 28 2008, 09:01 AM
It's rather easy to do this. I suppose you'll be working with different users, so first you'll need a user database with at least a user ID (a random number, you'll be using this quite often) and a login name. Next you'll need a password database, in this database you re-use the user ID and have another collumn containing the password (preferably save using MD5). So you have something like user database: CODE | ID | NAME | MAIL | | 11 | John | john@johnymail.com | | 12 | Frans | Frans@fransmail.com| password database CODE | ID | password | | 11 | 8896e76cb1c472a1847e75cf23324577 | | 12 | e36aea312ecf63d21b5d134b6998d529 | User 11 has password: hallo priteshgupta User 12 has password: dit is een ongeloofelijk lang en belachelijk wachtwoord om te gebruiken There's a lot of info available about creating login systems and the use of md5 in php (altough I do suggest to use javascript to use the md5-hash because this way you don't send any password in the clear). And of course, search the internet  , probably the best way to learn something.
Comment/Reply (w/o sign-up)
yordan
Oct 28 2008, 11:19 AM
If you like the "learn by example" way, you can also go at phpbb.com and download the phpbb3 environment forum, and have a look at their scripts for user logging.
Comment/Reply (w/o sign-up)
Nabb
Oct 28 2008, 11:21 AM
There's no reason to keep the user and password databases separate. One database should suffice, columns you would need are (feel free to change the names, e.g. password to psd, if you want): ID: Set this to auto-increment - Int with max length 4 should suffice, it allows for 10000 users, increase the length later if necessary User: A log-in username - Tinytext with max length 16 should be fine. Password: The hash of a password - Tinytext with max length 40. Sid: A session ID relating to a user - e.g. Tinytext with max length 40. Any other data you wish to keep can be stored as well, for example columns: LLI: The last logged in date Name: A user's first name etc. A hash function is a function which takes an input of any length, and returns a fixed-length output. Common hashes include MD5 and SHA1 (the latter is more secure). Hashes are used because they are irreversible (easily verified with the pigeon hole theorem). In a registration page, you should have a series of text boxes for each relevant column (i.e. username and password - plus extras you want like first name). On the page this data is submitted to, what you want to do it: Retrieve the data using $_POST['user'], where 'password' is replaced with whatever you named it in the previous page. You need some basic checks e.g. username is between 4 and 16 characters (long usernames are annoying!), username consists only of alphanumerical characters (or something similar). Calculate the hash of the password - e.g. $hash = sha1($_POST['password']); INSERT INTO the SQL database the relevant data. When you log in, (use a similar form to the registration form except only with username and password boxes), you should SELECT from the table WHERE the username and password (hash) match - if the mysql_num_rows($result) is 1 then success, else fail. You need to set a session ID associated with the account, which will be used to authenticate the user when he visits other pages. An example could be sha1($user+date("FjYg:ia"));. You need to UPDATE the session ID value stored in the database and set the value as a cookie to the client. When the user visits other pages, you should check whether the session ID is associated with any IDs in the database (basically logging in but checking for session ID match). QUOTE There's a lot of info available about creating login systems and the use of md5 in php (altough I do suggest to use javascript to use the md5-hash because this way you don't send any password in the clear). I hope you realise how stupid this is, this less less secure than sending passwords as plaintext. If a hacker is able to sniff the password sent, they can easily log in, yes. If it's a hash instead, they can easily spoof the request (e.g. tamper data, javascript injection, packet editor). However if there is an SQL injection vulnerability, a hacker will immediately be able to access any account, regardless of password strength, if the hash is done locally. If the hash is done on the server, one would need to first crack the hash.
Comment/Reply (w/o sign-up)
CheckProgs
Oct 29 2008, 01:58 AM
Again, you can always use md5-based logins instead of cookie-based logins. Here is an example. Notice the way it works, hopefully you already know PHP. It includes an admin center, a login/register system, profiling system, and a session check system. If you are the type of person who learns from examples this is the best file to use. Read all the comments to understand what is going on exactly.
Comment/Reply (w/o sign-up)
Nabb
Oct 29 2008, 03:50 AM
I don't get what you're trying to say - look at /include/session.php for example. Lots of cookies there. If you aren't going to have cookies, then the only options (which I can think of) are having to log in on every page, having some form of verification data (e.g. a session ID) on each link on each page, or storing the log-in data to be associated with your IP. I don't see how any of these are better than simply storing a cookie.
Comment/Reply (w/o sign-up)
khalilov
Oct 29 2008, 03:05 PM
QUOTE(Nabb @ Oct 29 2008, 06:50 AM)  I don't get what you're trying to say - look at /include/session.php for example. Lots of cookies there.
If you aren't going to have cookies, then the only options (which I can think of) are having to log in on every page, having some form of verification data (e.g. a session ID) on each link on each page, or storing the log-in data to be associated with your IP. I don't see how any of these are better than simply storing a cookie. I use that, $_SESSION['id'], it works and you don't have to relogin unless you close the window. It works fine and i think its better than creating and using a cookie since some antispyware or some browsers might block cookies from untrusted sites.
Comment/Reply (w/o sign-up)
(G)Khurram
Jan 7 2009, 05:49 PM
This is a good login system script of PHP which uses mySQL. It is simple but very effective. Check here yourself:
codingtricks.Blogspot.Com/2008/10/php-login-script-using-sessions-secure.html
-Khurram
Comment/Reply (w/o sign-up)
yordan
Jan 8 2009, 03:55 PM
QUOTE (priteshgupta @ Oct 28 2008, 08:43 AM)  have already made a database in http://www.sitebooth.com now what type of table When I try your URL, I get : QUOTE SITEBOOTH.COM HAS SHUT DOWN Please use this site for free web hosting: http://www.x10hosting.com/
Comment/Reply (w/o sign-up)
pyost
Jan 9 2009, 10:34 AM
I do not think making a login system is a good way to start learning PHP - if you are already good at PHP, do carry on. A simple login system might not pose a problem, but "simple" usually means "not secure". What is more, even the easiest ones need to make use of cookies or sessions, or even both. I have been writing PHP code for over a year now, and I still try to postpone writing login systems as much as I can  It might be a good idea to start with fetching data from the MySQL database, as this is one of the most simple tasks. You can also install different web applications and examine their MySQL structure - reading their PHP code as well is not a good idea, as these applications have very complex coding.
Comment/Reply (w/o sign-up)
iGuest
Jul 27 2009, 03:34 PM
Multiple Login Help
Login System
I have a website www.Musicseensa.Com and I want to try and make it easier for the user to navigate it. I am really new to mysql and don't really know how to do much on it but I currently have 4 databases set up and would like to make it to where people don't have to log in multiple times. I have wordpress set up with one user name and password and then zencart with another and simplemachinesforum with yet another and want to consolidate them into one database so that people only have to log in once to use all the services. Any help would be greatly appreciated.
-question by Oscar
Comment/Reply (w/o sign-up)
iGuest
Jul 3 2009, 04:42 AM
What do you use to make and edit a mySQL database table?
Login System
What do you use to make and edit a mySQL database table?
thats all I need to know!
-reply by Julian
Comment/Reply (w/o sign-up)
Similar Topics
Keywords : login, system, make, login, system, mysql, amateur, thing
- Mysql Overhead
(3)
Mysql Multiple Tables
(3) It is good practice to use multiple tables to sort out big amounts of data. But once you do that it
becomes increasingly hard to cross reference the tables. Mysql has a little beautiful command
structure that they have added. You can select multiple tables within one sql query. Example of a
basic sql query CODE $sql = "SELECT * FROM table WHERE row=1"; If you noticed that I selected
all of the rows in the table. Normally you will try to not select the entire table from the database
unless you absolutely want all of the table. I would recommend against it; just gra....
Any Website Provide Free Host Mysql Host?
(4) any website provide free host mysql host? i need it because i am using 000webhost.com now but it
only provide 2 mysql database... can i know where or how can i get more databases regards....
Mysql On Computer
XD (9) I posted PHP on computer? , but for some reason it doesn't show :/. Anyways I am wondering if
there is MYSQL on my computer, meaning can i make a data base on my computer? that way i make what i
want and upload it when i get hosted =)....
Mysql Database Entry By Excel Sheets
(2) Hello .. I would like to ask if i can use use Microsoft excel files in order to make entries to
mysql database. Thanks....
Mysql Database Management
(1) Hi i am new, I have a problem in understanding the query decomposition in D-DB. Can anyone help me
to understand the first question of the exercise 25.21 of Elmasri-Navath 4th edition? Consider the
following relations: BOOKS (Book#, Primary_author, Topic, Total_stock, $price) BOOKSTORE (Store#,
City, State, Zip, Inventory_value) STOCK (Store#, Book#, Qty) Consider a distributed database for a
bookstore chain called National Books with 3 sites called EAST, MIDDLE, and WEST. Consider that
BOOKS are fragmented by $price amounts into: B1:BOOK1:up to $20. B2:BOOK2:from ....
Mysql And User File_priv
(0) HI, I've hit the grain while trying to import file to mysql database - I need to enable file
permissions of the database user but this seems not possible with most of the hosting providers.
The problem is to set file_priv of the database user to "Y" . This is done in the "user" table of
the maintanance database named "mysql". cPanel doesn't allow this. Via the cPanel you can only
allow privileges on table querries but you cannot grant host file privileges to the database user -
which makes querries like: "LOAD DATA INFILE 'filename' INTO TABLE tablen....
I Have An Error With My Mysql Connection
mysql connection error (7) ok so here's my web page... http://lacrossems.t35.org/ it only lags cause its trying to
connect to the my sql server...i followed this guide
http://forum.ragezone.com/showthread.php?t=387249 and when i edit my config.php to my host and
login info i always get the error cannot connect to the database here is my config.php if you can
help me CODE $host = 'CENSORED'; // my host $host =
'righto'; // my database username $host = 'CENSORED'; // my database
password $host = 'odinms'; // my datab....
Mysql Backup With Another Address?
(4) I just got my site hacked!! (don't worry because it is not on astahost) Actually it is a
wordpress blog. So I backed up my MySQL Databases with cpanel. Now when I get my hosting approved
here at astahost, can I restore those backups? Is the change of the site address going to interfere
with this? Is there anyway I can edit those databases to work with my new address? Please help me
out here!....
Sun Bought Mysql
(6) SUN bought the swedish company MYSQL for much money, around 2million each worker got in the company,
they did it to come in to the database market, is it a good reson to buy it?....
Mysql - So Hard
Come in here if you think MySQL is soo hard! (14) Doesn't anybody think MySQL is so hard to code? I mean think about it, you need loads of
databases just for one little script and you have to type things in like ;Host-Username:
(blahblah) ;Host-Password: (blahblah) ;Host-DatabaseName: (blahblah) Ok, that MySQL code was
random, and it is alot harder than that. If you have expierenced it being hard, you are free to
post right in here, mate.....
Access
Is this easy to make a login/password? (17) I was looking to make a site where people need to create an account, and log in to view the main
pages. Is it easy, or do-able, to use msoft access to make a database where people are able to sign
up with a username and password via my website?....
Login System Using A Mysql Db
How do i do this? (5) Hi guys, ive got a registration system that looks something like the one below: Firstname:
Lastname: Then i have inset.php, which looks like the following: $con =
mysql_connect("localhost","autobot","abc123"); if (!$con) { die('Could not connect: ' .
mysql_error()); }mysql_select_db("my_db", $con);$sql="INSERT INTO person (username, password) VALUES
('$_POST ','$_POST ')";if (!mysql_query($sql,$con)) { die('Error: ' .
mysql_error()); } echo "1 record added";mysql_close($con) ?> Now my question is, how do i creat....
Mysql And Php
When trying to install Joomla (16) I don't know if this is the correct forum, but here is my question: I'm trying to test
Joomla and some forums in my computer, I have already installed MySQL with the GUI tools, Apache,
and PHP with the MySQL and MySQLi extensions, but when I'm trying to install Joomla I get this
error: Required Settings Check: ------------------------------------- PHP version >= 4.1.0
Yes - zlib compression support Available - XML support Available - MySQL support
Unavailable configuration.php Writeable Session save path Unwriteable Not ....
Permission Problem With Mysql Database Creation
Please Help! (8) I seem to have a problem with accessing my database with proper permissions. I have set the my
database correctly giving my db username all priviliges yet i seem to be unable to even log on with
this username with a denied access error. Any ideas on resolving this?....
Navcat For MySQL
is Navcat any good? (9) Hello all, i ve recently come across NavCat (GUI tool) for MySQL. I have not bought a copy yet, just
played around with the demo. Has any one used it beore, if so please let me know if its worth
buying. I already have PhpMyadmin, Just wanna know if NavCat is better than PhpMyAdmin in usibility
and functionality. Regards....
Is It A Good Practice To Store Image Or Other Binary Files Directly In A Mysql Database
(6) Hello to all of you beautifull people out there, I am new to MySQL, i just wanted to know if its a
good practice to directly store images and other binary files in a MySQL database. Any one with
help? Thanks....
MySQL, Multiple Tables
(27) Ok, I'm coding a project which is a leap than what I'd normally do. Before, I've always
learned ONE table... put EVERYTHING in one database table. I'm making a profile system so there
needs to be at least two tables: 1 for users, 1 for content. My problem is, how do I link the two
together? I could probably figure this out faster if someone explained and posted sample SQL code
that shows how the two are linked together. Thanks!! F....
MySQL Output Database Question
(19) I am new to MySql and have just created a database after using a script. My problem is not the
script, but what it says about putting it into the output file. I cant figure out the right terms
to put it in, I keep getting errors. I try using; SELECT*FROM 'database name' WHERE
'location' but it isnt working. I'm lost with this stuff, I really am. Can someone
please help me out?....
MS-database To MySQL
I'd like to batch them (6) Hi, maybe one of you already came across this, so I ask. I'll continue searching on. I've
got two vocable trainers, one is Windows-native, the other one is on the web. While I can't
control the output of the Windows-thing (so I can't export them to a *csv or something), I can
write an import script. But since I'm not that great with Regular Expressions and don't know
anything about *.mdb (that is MS SQL, isn't it?) files, I would need some finished thing to make
out the field information and put it in arrays or something more readable. It wou....
What Are The Alternatives To MySQL
(7) Hi. i'm interested in alternatives to MySql combined with php. what database else can i use to
create a webbased managment system with a lot of entries. maybe more than mysql can handle fast
enough. it should be more powerful than mysql and should have nearly the same features. i hope
there is a webbased administration program like phpmysqladmin thanks for your help ! greetings c.....
How To Connect MySQL With Flash?
Help me connect my flash Work with MySql (8) I know Flash and mysql but could not figure out if I could ever connect these? I want to have a
dynamic content in my flash object that could be retrieved from the database directly without myself
needing to update it again and again. How can I achieve this ? Do I have to install any additional
controls or connectors to do that ? If yes any one tell me....
Mirror My MySQL Database To Another Mysql Server
(7) Hi..I want to ask if its possible to automatically mirror my mysql databases into another mysql
server?or create a small php script to do this? The reason is because, we all know that database is
very improtant if we have dynamic website. I have my forum hosted and i want to automatically
mirror this or backup into another mysql server(free). Like in freesql.org. So that im not afraid
that i forgot to backup my database..also i have one central backup database. Thanks for the
help..Im looking forward for this posibility.....
Recover Tables From A MySQL .frm File
(9) I have a couple of .frm files with no corresponding data or index files. Is it possible to recover
the table structure (field names, types, sizes, rows,col, etc) from these files? The table type is
innodb....
MySQL Database Problems
(8) My friends have a little forum running here . The problem is that quite often we get the following
message when we try to open the page: QUOTE Warning: mysql_connect(): Can't connect to
local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in
/home/vhosts/rohit.bizhat.com/forums/db/mysql4.php on line 48 Warning: mysql_error(): supplied
argument is not a valid MySQL-Link resource in /home/vhosts/rohit.bizhat.com/forums/db/mysql4.php on
line 330 Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in
/home/vhosts/roh....
Error In Installing MySQL Server
MySQL server cannot be started (9) I try to upgrade my MySQL server from 4.018 to 4.1.10a. Firstly, I downloaded mysql-4.1.10a (not the
essential one) for win XP Then I install the new version after the old version was uninstalled.
After the installation process, Instance Configurator comes up to help for the configuration. But an
error occured when it try to start the MySQL service. Error messageis "cannot create windows
service for MySQL. Error:0" So my MySQL server cannot be started. It is running win XP on my
computer. Does anybody can tell me what is wrong?. Thanks (sorry for my bad english)....
How Can I Import Csv Files To My MySQL Database?
I was able to export but where's import? (3) I am having hard times finding that import csv in the mysql phpmyadmin. I once worked on some csv
files and someone imported it on the mysql server. I was not able to ask him. Does someone know how
can I import csv files in mysql server?....
MySQL Datetime --> VB.NET Datetime Conversion Prob
Any solutions ?? (4) Hi, Can anyone provide me with a quick example of fetching a MySQL Datetime Field and converting it
into native VB.NET DateTime format ?? Say for example my db contains a couple of fields: Field1,
Field2, DateField... one of which is the default MySQL DateTime. Say I'm using the following
code to connect... CODE ConnectionString = "....." QueryString = "SELECT * FROM SomeTable" Dim
myConnection As New MySql.Data.MySqlClient.MySqlConnection(ConnectionString) Dim myCommand As New
MySql.Data.MySqlClient.MySqlCommand(QueryString, myConnection) Dim myReader As MySq....
MySQL Realtime Replication
how to replicate mysql in realtime (4) i dont know if this might be useful to ppl here, but this is a very good knowledge for serious
siteadmins. while i was digging for mysql backup techniques, i've found that mysql is able to
do realtime replication. the idea is that there are master server and slave server. both are having
the same version of mysql installed. the data flows; Master >copy> Slave ( in realtime!)
you'll never have to manually copy the database file of wasting your time to manually use the
mysqldump command. here are the links; http://dev.mysql.com/doc/mysql/en/Replication_HOWTO.h....
MySQL - Trouble With Bulk Insert Statements
(3) I'm trying to insert about 500 rows into mysql, but I keep getting errors. If I copy and paste
too many (about 50) insert statements at a time I get errors sometimes. I sometimes even get errors
but then the row is skipped so I don't know there was an error (I'm using linux and SSH).
What's the best way to get my insert statements to put the data in MySQL? Is there anyway that I
can have it tell me if there where any errors all the statements are executed? Thanks for your
help.....
Looking for login, system, make, login, system, mysql, amateur, thing
|
See Also,
*SIMILAR VIDEOS*
Searching Video's for login, system, make, login, system, mysql, amateur, thing
|
advertisement
|
|