Jump to content

searching record fields in text files


leeharvey09

Recommended Posts

function search_password(){
$file = "username_passwords_record.txt"; 
$record_rows = file($file); //file — Reads entire file into an array
foreach ($record_rows as $value) {
$explode_values = explode(",",$value);
echo $explode_values[0] .  $explode_values[1] . $explode_values[2] . $explode_values[3]. $explode_values[4] . "<br/>";
}
}
search_password();

 

i have a text file to store some records with

 

Fields: Ip,date,email,username,encrypted password

 

test values in text file : username_passwords_record.txt

 

127.0.0.1,08.03.10,[email protected],Google Analytics,MjJvbWxramhpZ24yOGRiZWZhYzg5

127.0.0.1,08.03.10,[email protected],Amazon store,MjVvbmhtaWdqa2wzMGNmZGJlYTI5

127.0.0.1,06.03.10,[email protected],kill hill,MzdsbWluZ29qaGs2M2NhZGJlZjYz

127.0.0.1,08.03.10,[email protected],Simon Hutton ,NDZrbGdtaGppbm82NWRmYWNlYjUy

127.0.0.1,08.03.10,[email protected],carsales,NDNpa2xubW9namg1NGFiZmRjZTY2

 

i wanna be able to scan and compare any of these fields, with the value the user has entered, to check if they match...

any help would be great thanks

 

Lee Harvey

Link to comment
https://forums.phpfreaks.com/topic/194487-searching-record-fields-in-text-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.