FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP Member System (using FOPEN)..





Diablosblizz
Okay, this may seem odd, but I want to use FOPEN to create a member system. How? Well, users are already registered on my site, so then when they login, the php script will open up their pass file and then if it is a match to what they submitted they will get into the member system..

So far, I have a little bit of code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Create A File</title>
</head>
<body>
<form name="input" method="post"
action="index.php">

<input type="text" name="username" id="dj" /><BR>
<input type="password" name="password" id="pass" /></p> 
<p><input type="reset" name="reset" value="reset" />
<input type="submit" name="submit" value="submit" /></p>
</form>
<?php

if (isset($_POST['submit'])) {

$djsays = $_POST['username'];

$fp = fopen("path\to\the\folders" .$djsays "\pass.txt","w");

}
?>
</body>
</html>



What I want the code to do, is go to the folder that I will specify, so the $djsays will be the username that they submitted..

So far, this only gets the login, once i figure this out I will understand how to do it.


So, my problem is that nothing shows... I want the user to submit the username and then it takes it and sees if it exists.. but nothing shows. How do I fix it?


Thank you very much.
Gundamxxg
To be completely honest the flat file sort of database you are going for is pretty intense. I think you would have a little bit better system if you were to use a database to store the username and pass info. I can however, look at your code and see where you are trying to go. Ill code out a sample and try to help you as I can. In a flat file database though I don't know how useful my help will be. =|
Diablosblizz
Well, the script will include how to change their passwords.. the whole member system is connected with the whole site, so its useful.

Thank you for the code Smile.
[FuN]goku
wouldnt it be better to just write one in with mysql? it would be alot more secure... i mean if you plan on storing users and passwords in a file... then if someone finds out where the file is then they could download it and do some damage to your site maybe.... even if you use md5 encryptions on the passwords it still would be kind of "in-secure" imo but its up to you!
Diablosblizz
Quote:
wouldnt it be better to just write one in with mysql? it would be alot more secure... i mean if you plan on storing users and passwords in a file... then if someone finds out where the file is then they could download it and do some damage to your site maybe.... even if you use md5 encryptions on the passwords it still would be kind of "in-secure" imo but its up to you!


True, but members have been put onto this database .txt file through a game I made (not released yet, only beta testers, and I couldn't figure out how to make mysql).. I put the directory into other directorys which I hope will be confussing. Anyways I found a code on zymic.com and Im trying to get help.
HabPie
Hmmmmmmmmm, You Can Always Wait For Me To Post A Tutorial Of A PHP Member System With No Databse.

PS:
Do You Play Habbo?

Regards, HabPie (Sam)
manum
what u want is a flat files based login system....

many of them can be found on http://php.resourceindex.com

enjoy!!!
Related topics
Php link system
PHP - BBcode Parsing
Witch PHP board system is the best?
Password Protect my site
Can I refresh a page using php?
Looping & echo ini Php with out using while or for
Developing a Login System with PHP and MySQL
php download system prob
Creating a member system
Problems with Member System (RMB-SCRIPTING)
PHP reading a line?
Problem with Member system(or template) and $_GET[id]
what do you recommend for intranet system using java N OODB
Php Warning: fopen
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.