I would like to use PHP to do something like a unix 'grep' for an e-mail address ($email) and have it search through a group of files looking for duplicates.
The 'username' (below) is generated from a form (Example: terry).
$query_table = "SELECT * FROM customer WHERE Email = '$email';
$entry_check = mysql_query($query_table) or die("Query failed");
$row_entry = mysql_fetch_array($entry_check);
$new_character = strtolower($username);
$filename = "/directory/".$new_character[0];
The filename does like: /directory/t/
Now what should happen is when the user submits 'terry' as the name, the php code would query the database the user's e-mail address and use it to 'grep' for its use under the /directory/ file listing (there are multiple files in the directory).
If e-mail not found under directory files, it should just return a '0', but if found it should kick off a header() function denying the user the ability to create another file.
Anyone got an idea on how to make something like this work?
-- M