More PHP Problems

Posted by gamehawk on Feb. 23, 2006, 5:24 p.m.

I'm making a registration system, no MySQL. How can I make it, without using PHP' FTP commands, that a script can read text from a file, but a person can't. For example:

U/N:

Password:

Submit <–Click, reads text from file to see if UN and password are correct

but a person can't go

http://blahbalh.com/mytext.txt and view the password. There has to be a way to completely block access instead of just encrypting it but still being able to view it. I messed with CHMOD settings, and can't seem to get that working, am I missing something?

Comments

ludamad 18 years, 10 months ago

Why on earth a text file?

gamehawk 18 years, 10 months ago

Do you know PHP, anyways can you help me?

gamehawk 18 years, 10 months ago

Okay, how do you reverse hash

gamehawk 18 years, 10 months ago

Never mind.

Maxcore 18 years, 10 months ago

Why don't you buy a book?

Maxcore 18 years, 10 months ago

USE t3h CHMOD PROPERTIES! ALSO, use a DB.

firestormx 18 years, 10 months ago

Firstly, to answer the question in your previous blog, I've parsed out every bad tag I know of. (you can do stuff like [<]/table>, and stuff…But really, you're just wrecking your own blog, and that's all)

Secondly, a text file is a REALLY BAD, really innefficient, and slightly less secure way than using a DB.

However, if you must use it, the only way I can think of to only let the server access the files (and not outside users) is to set it to either 600, or 650…I'm not sure if 600 will block out php scripts or not. (You understand what the numbers in chmod represent, right?)

Once your site gets big, you're really gonna regret using text files…But it's a good way to learn about working with dynamic data.

The first dynamic site I built used text files. I thought text files was the solutions to all my problems, without having to go through all the work of learning about databases…But now that I understand databasing, it's so much nicer, and I'm able to do a whole lot more.

As you grow in PHP, the pressure to learn databasing will increasingly grow, but text files really helped me grasp databasing once I decided to learn about it.

gamehawk 18 years, 10 months ago

Yes, I understad the numbers. FSX, it's your server. I used PHP info, is MySQL installed on it, it says it was. How do I create a new account on it though?

gamehawk 18 years, 10 months ago

So, I'll go with text files for now. Later learn MySQL