Not a Member Yet,
Click here to Register
How do you like the new design?






ID: 63
Viewed: 5731
Added: Jan 18, 2003
Version:
Snippet uploaded by: snippet
Written By: snippet
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

this will cycle through a file in search of the users email addy. the file is setup like this:

contents of file.txt

1|me|something
2|you|something2
3|him|something3

the script will seperate the contents form the | line and store each one in an array.
it will print to the screen when the script finds the input from the user and display that line.

<!---Head--->
none

<!---Body--->


 <?
echo "<html>
<head>
<title></title></head>
<body>";
If ($submit){
$fileread = file("file.txt");
$arrlen = count($fileread);
For($i = 0; $i < $arrlen; && ($found==0); $i++)
{
$fsp = explode ('|',$fileread[$i]);
If($fsp[0] == $ID)
{
echo"$ID <p>ID = $fsp[0]<br> Name = $fsp[1]<br>Whatever = $fsp[2]";
$found = 1;
}
}
If (!$found) {
echo "found no matches";
}

}Else {
echo "<center><form action="$php_self" method="POST">";
echo "<input type=text name="ID" size=5>";
echo "<input type=submit name=submit value=submit></form>";
echo"</body></html>";
}

?>


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2017 snippetlibrary.com All Rights Reserved. Conditions