This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Login System using SQL
Started by GlassOS, 28 September 2014 - 09:33 AMPosted 28 September 2014 - 11:33 AM
Hey, I want to have part of my protection a password system for my computers/turtles but i want all the usernames and passwords to be kept in a MySQL Database would anyone know how i could achieve this?
Posted 28 September 2014 - 12:25 PM
I'm sure there's a way to do so. It isn't going to be easy, and would probably be rather cumbersome. The better question is, why do you want to do this?
Posted 30 September 2014 - 10:24 PM
Get A Server With PHP And Mysql Installed.
Then Create A PHP Script Which Interfaces With The Sql Server And Returns A Message Of Authentication.
Here Are Some Links To Help
Connect To Mysql
Select Data From Database
Then Create A PHP Script Which Interfaces With The Sql Server And Returns A Message Of Authentication.
Here Are Some Links To Help
Connect To Mysql
Select Data From Database
Posted 04 October 2014 - 07:06 PM
Lyqyd, it would be a much more secure system if you wanted an operating system with administration statistic page that people culdn't just find the login details
Posted 05 October 2014 - 06:27 PM
Thats where Encryption, and Hashing comes in placeLyqyd, it would be a much more secure system if you wanted an operating system with administration statistic page that people culdn't just find the login details
Take a look at this Hashing API, and Encryption API's are easily found in the Apis and Utilties forum.
:P/>
Edited on 05 October 2014 - 04:28 PM
Posted 05 October 2014 - 07:54 PM
You could make a web page that interacts with the mysql server, then with the HTTP api, you could interact with that website in question. I think the HTTP api can do that right?
Posted 07 October 2014 - 10:07 AM
Create PHP file, mysql_connect(paramsfrom$_POST/$_GET) // I'd say post is better.
mysql_query( $_POST / $_GET )
aaaand that's it.
BUT. BUTT. BUTTS.
Doing it as in this way will leave your MySQL totally open to anything, such as a full-takeover or drop of everything.
So if you limit queries as in PHP and use your HTTP query to specific actions you can get it better & secure.
mysql_query( $_POST / $_GET )
aaaand that's it.
BUT. BUTT. BUTTS.
Doing it as in this way will leave your MySQL totally open to anything, such as a full-takeover or drop of everything.
So if you limit queries as in PHP and use your HTTP query to specific actions you can get it better & secure.
Posted 10 October 2014 - 02:14 PM
I might be going a little too off-topic here, sorry if I am, but I feel the need to point out: Never, ever use the mysql_ functions anymore. They're deprecated and aren't secure.Create PHP file, mysql_connect(paramsfrom$_POST/$_GET) // I'd say post is better.
mysql_query( $_POST / $_GET )
aaaand that's it.
BUT. BUTT. BUTTS.
Doing it as in this way will leave your MySQL totally open to anything, such as a full-takeover or drop of everything.
So if you limit queries as in PHP and use your HTTP query to specific actions you can get it better & secure.
The mysqli_ functions are the most similar, but I feel as though PDO (PHP Data Objects) is most useful.
On topic now: Yeah, a PHP API would be the best way to have an SQL server in ComputerCraft. A bonus is that it's not like an SQLite database on a computer in-game, so there's literally no way to steal the database and find out the password. Downside? It'll require knowing a thing or two about writing PHP, but that's not too hard. Oh, and you'll need a dedicated server box to host the data server.
Posted 23 October 2014 - 06:57 PM
I own a webserver with SQL access and have it sort of working (rianscode.com) It is very complicated the sourse but if i simplify the code ill post it
Posted 24 October 2014 - 04:38 PM
Hey, I want to have part of my protection a password system for my computers/turtles but i want all the usernames and passwords to be kept in a MySQL Database would anyone know how i could achieve this?
I have this up and running, if you need help or the scripts, pm me and I shall give you them! and even set them up if you need :')
All you need to do is make the php file take in a username and a password then echo true or false :)/>
Email me if you need: [REDACTED]
[EDIT]
It really isn't hard to do, it's pretty simple when you get it!
Edited by