Anyone know php?

Altec88

New Member
Ok, I'm trying to make a simple username,password system, and I need to know where the { } marks go. This is my first time with php. Here is the code:

<?php
$found=0;
$filefopen("members.dat", "r");
(!feof($file))
$line=fgets($file,255);
$line=chop($line);
$field=split("#",$line,6);
if($username==$field[0])
$found=1;
if(password!=$field[1])
print "<h2>Wrong Password</h2>";
die();
if($found==0)
{print "<h2>Username does not exist</h2>";
die();
?>

Thanks a ton! I don't understand these marks.

This part is supposed to authenticate a user before displaying the page.
 
Im just playing with this junk too... This is a guess.
<?php
{
$found=0;
$filefopen("members.dat", "r");
(!feof($file))
$line=fgets($file,255);
$line=chop($line);
$field=split("#",$line,6);
if($username==$field[0])
$found=1;
if(password!=$field[1])
print "<h2>Wrong Password</h2>";
die();
if($found==0)
{print "<h2>Username does not exist</h2>";
die();
}
>
 
Code:
 <?php
{
$found=0;
$filefopen("members.dat", "r");
(!feof($file))
$line=fgets($file,255);
$line=chop($line);
$field=split("#",$line,6);
if($username==$field[0])
$found=1;
if(password!=$field[1])
print "<h2>Wrong Password</h2>";
die();
if($found==0)
{print "<h2>Username does not exist</h2>";
die();
}
>
i see your taking a leaf out of c# and C++'s book then... that would be logical, nice though but not right, you might want to PM people like cromewell and mgoldb2, they are good at PHP, i am ok, know the basics but nothing quite like what you are displaying there.
 
Back
Top