Click to See Complete Forum and Search --> : print to file...


xataku_nakusute
08-09-2003, 04:36 AM
for a username/password script im making....or at least, trying to make, i need a bit of help....
how can i make the actual database part...?
i know you can use sql...but ive been trying for weeks to just get sql installed on my server, but it isnt working...
so im figuring i can make it so i can have new users' usernames and passwords passed over and printed to a file...so when the username and password are validated at the login page, the script will just read and search through my file.
so, basically, i need to know how to write and read to and from a separate file....

if you have an answer, or simply, another approach to this, pleaz feel free to respond

thanx!

Exuro
08-09-2003, 10:36 PM
You can use fopen(), fread() and fwrite() to manipulate files on your server. You can read about all these functions in the online PHP function list. Here's a link to each of them:

http://us2.php.net/manual/en/function.fopen.php
http://us2.php.net/manual/en/function.fread.php
http://us2.php.net/manual/en/function.fwrite.php

Hope that helps!

pyro
08-09-2003, 10:39 PM
Be careful using a flatfile for username/passwords, as it could compromise the sercurity of your site. If you end up using a flatfile, be sure to place it in a directory above the root directory, so users can't just type the filename in their browser and get all the usernames/passwords.

brendandonhue
08-09-2003, 11:02 PM
and make sure you run BOTH usernames and passwords through the MD5() functions.

xataku_nakusute
08-10-2003, 03:02 PM
uhhhhh......:confused: *drool*....

sorry, that was my bad ear...lol
sorry to say this, but im not much of a php person yet...im just a beginner with server side....and, pyro, my whole username and password thing isnt supposed to be too heavily secured....sorry, i failed to mention that it is simply to track users preferences...colors, display, other misc account info...

so, sorry i did not mention to you all a few of the more important details...they mustve absent-mindedly passed me.

but anyway, thanx for the help!
ill be back soon to try to decipher what you guys just said once i learn more bout php

xataku_nakusute
08-10-2003, 03:41 PM
ok....maybe then, i need the whole script...i just dont know what to do now....its not so much that i need security or actual usernames....but i just need to setup sessions for people...

my site is for webdevs and i want to make certain options and stuff only available to people who have passed some quizzes and went through tutorials....much like a video-game whereas you can "unlock secret characters" and stuff after completing the game or certain sections of the game. and the reason why im not just using sessions is in case there is more than one person using the same pc and accessing the site.

pleaz help me.
and though my pleas have alwayz failed in the past. if you have the time, you may pm me some stuff to help me with some of the more basic stuff. i kinda need a "tutor" for this stuff cuz im just not understanding php much though its prolly the most comprehendible lang in the world according to most people.

thanx
i hope you take my above notes into consideration