Can any one help with this script if you want to see this go to:
http://hhut387.t35.com:8000/users/main-page.htm
Their are 2 php files hear is the source code
if you need any thing else let me know thanks.
-----<LOG.PHP>-----<"LOG IN FILE">----
<?php
$id = $_POST['id'];
$pass = $_POST['pass'];
$lines = file("pass.txt");
$data = explode("||", $lines[$id]);
if ($data[0] == $pass) {
echo "cool!";
}
else {
print "go back and try againg";
}
?>
-----<REG.PHP>-----<"SIGN-UP FILE">----
<html>
<head>
</head>
<body>
<?php
$password = $_POST['password'];
$writeline;
$incrid;
//opens password file and writes password
$fp = fopen("pass.txt", "a");
if(!$fp)
{
echo "ERROR : FILE CAN NOT BE OPNED!";
exit;
}
$writeline=$password."\n";
fwrite($fp, $writeline);
fclose($fp);
//opens id.txt and increments the id number
$lines = file("id.txt");
$data = explode("||", $lines[0]);
$incrid = $data[0]+1;
$fp2 = fopen("id.txt","w");
if (!$fp2)
{
echo "An error has occured and the file could not be open!";
exit;
}
fwrite($fp2, $incrid);
fclose($fp2);
?>
<div align="center">
<center>
<table border="0" width="986" height="1" cellspacing="1" cellpadding="0" bgcolor="#008000">
<tr>
<td width="986" height="1" colspan="2" bgcolor="#FFFFFF"><?php
print "RECORD THIS INFORMATION IN A SAFE PLACE. YOU WILL NEED TO OPEN A NEW ACCOUNT IF YOU FORGET THIS INFORMATION!\n";
?></td>
</tr>
<tr>
<td width="172" height="1" bgcolor="#FFFFFF"> <?php
print "<b>your id# is:</b> <i>$data[0]</i>";
?>
</td>
<td width="798" height="1" bgcolor="#FFFFFF"> <?php
print "<b>your password is:</b> <i>$password</i>";
?>
</td>
</tr>
</table>
</center>
</div>
<p><a href="signin.htm">L</a><a href="signin.htm">ogin</a></p>
</body>
</html>
help with this script
Moderator: General Moderators
-
like_duh44
- Forum Commoner
- Posts: 63
- Joined: Sat Jul 26, 2003 6:57 pm
Contents of pass.txt youre using.
You cant explode with || if you dont provide it before writing a new password to the file...
Code: Select all
silver79 1 foo