7 Replies - 3573 Views - Last Post: 25 March 2010 - 02:55 PM Rate Topic: -----

#1 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 817
  • Joined: 16-September 09

Login Script without the use of a SQL database

Posted 24 March 2010 - 04:40 PM

So, little background..I've successfully built two login scripts, via PHP, for a few websites. By no means am I a pro at this..I'm still learning.

I have a friend who started a website for her company and I want to create a login page for her. She used Google to host (mildly disappointing for anyone who has programming ability) and I can't find a SQL DB anywhere. This prompts 2 questions:

1. Does anyone know if Google Hosting provides any SQL DB's and where I would find them?

2. If not then is it possible to build a login script without the use of SQL? If not in PHP then in any language?

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Login Script without the use of a SQL database

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10596
  • View blog
  • Posts: 39,257
  • Joined: 27-December 08

Re: Login Script without the use of a SQL database

Posted 24 March 2010 - 04:46 PM

You might want to take a look at PHP MyAdmin, which was designed for interaction with a MySQL DB.
Was This Post Helpful? 0
  • +
  • -

#3 JennaPeterson88  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 39
  • Joined: 17-March 10

Re: Login Script without the use of a SQL database

Posted 24 March 2010 - 09:53 PM

If you do go the route of programming a login system that does not connect to a database, yes there are ways, but you're going to need to take a lot of precautions safeguarding your scripts from potential hackers. There are many ways such a login could be handled, some more secure than others. The simplest, but possibly least secure method, would be to have a single sign-in for everyone who will be signing in, and the values would have to be stored in the script, encrypted or otherwise (though obviously encrypted is best). You could also store multiple user name & password combinations in a file to be called upon by the login script instead of a database, but once again, this poses security risks. Most methods of calling information from another file and not from a database is going to display said information right in the source code of the page when a user chooses to view it.

Alternatively, there are database services out there that can be used if you find that your friend's hosting set-up does not include databases.
Was This Post Helpful? 1
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: Login Script without the use of a SQL database

Posted 25 March 2010 - 05:04 AM

Google supports PHP? Do you have a link for that?
Was This Post Helpful? 0
  • +
  • -

#5 DeathStory  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 43
  • Joined: 13-November 09

Re: Login Script without the use of a SQL database

Posted 25 March 2010 - 09:23 AM

I may be wrong but isn't it possible to just connect to a remote SQL Database if u have all of the login and host info? Again i may be wrong but im pretty sure you can
Was This Post Helpful? 0
  • +
  • -

#6 edu2004eu  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 81
  • Joined: 27-August 07

Re: Login Script without the use of a SQL database

Posted 25 March 2010 - 11:49 AM

If you only need few users and don't need a sign-up script, then you could try something like:
<?php
if($_POST['username']=="admin" && $_POST['password']=="admin"){
//logged in
}
?>


I know it's cheesy, but it's effective if you have only one or so users.
Was This Post Helpful? 0
  • +
  • -

#7 JennaPeterson88  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 39
  • Joined: 17-March 10

Re: Login Script without the use of a SQL database

Posted 25 March 2010 - 01:04 PM

The above is what I was talking about for a single username & password, but you have to be careful, because anyone can view the source code of that page and read what the name & password are.
Was This Post Helpful? 0
  • +
  • -

#8 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: Login Script without the use of a SQL database

Posted 25 March 2010 - 02:55 PM

There's no reason you can't use a Unix-style passwd file either. Just md5 the password with a salt and save the file in a non-web-accessible directory.

username:md5hash-of-salted-password
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1