Login Code Without A Database

Need code for Fraternity Login page

Page 1 of 1

3 Replies - 1373 Views - Last Post: 21 January 2009 - 03:50 PM

#1 blsmit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 21-January 09

Login Code Without A Database

Posted 21 January 2009 - 02:16 PM

Hi guys I'm new here but have been viewing your forum looking for a solution to my problem. I have been asked to create a Login sections for members of a Fraternity at my college. I have contacted the administrator about doing this, he is not very much help and only informed me that although PHP works there is no MySQL Database, and as far as I know no database for the organizations portion. I imagine the easiest solution would be to create a text file with a list of username and passwords, that the login code can read and determine if those who are signing on are on the list with the correct password. This file would then be tucked away in some off corner of the directory. (The text file might even be encrypted??) The code wouldn't even have to add users to the text file, I can add people and tell them the information in person. I'm very confused by this whole idea.

Also, if I find a code how would i set up the secure website section, as in, would there be a folder on the directory called "secure" and what would be stopping none members to go directly to ".../secure/index.html"?

Thanks to whoever reads this and posts a response.

Ben

Is This A Good Question/Topic? 0
  • +

Replies To: Login Code Without A Database

#2 capty99  Icon User is offline

  • i am colt mccoy
  • member icon

Reputation: 98
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Re: Login Code Without A Database

Posted 21 January 2009 - 02:47 PM

yeah, I mean, I always use a database, but last semester we were forced to use a flat text file so its not that hard, you just have to set up your system right so it reads them in correctly.

so if my text file was something like this :

username1:password1;username2:password2;

you would just pull out everything, drop it into an array, then when someone logs in just compare that input to the array or hash or whatever you wanted to do.

i mean how secure do you want it, for the most part just having an include on the page with an if logged in statement then display page, or an else force them to log in will work. i'm no security expert but if its a bunch of fraternity peeps conversating your probably good.
Was This Post Helpful? 0
  • +
  • -

#3 teampoop  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 140
  • Joined: 19-June 08

Re: Login Code Without A Database

Posted 21 January 2009 - 02:55 PM

You could use an XML file as your "database" and then using PHP and the simpleXML functionality, emulate a database. SimpleXML is enabled automatically with PHP 2.4 or higher (I believe). XML file would be simple
<users>
  <user>
	<name>Bob</name>
	<password>password</password>
   <otherinfo>Other info</otherinfo>
  </user>
</users>



Of course, there are all sorts of security issues with this, so at least MD5 the passwords before entering them.

Ping me if you have any questions, but the documentation is pretty solid.
Was This Post Helpful? 0
  • +
  • -

#4 blsmit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 21-January 09

Re: Login Code Without A Database

Posted 21 January 2009 - 03:50 PM

That makes sense, but I failed to mention that I am extremely new to this sort of thing so what would the php code look like. I understand the xml code but I've never worked with PHP can you help.

Also, I understand what MD5 is but can you explain it in more depth, and how to use it.

Thanks once again.

Ben
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1