Simple names, phones, addresses, and tags search, filter, and downloads prototype. Not intended for production use.
Serve this project directly using an HTTP server with a PHP interpreter (e.g., Apache, Nginx, or PHP's built-in development server). The main entry point is /index.php.
Run the following command from the project root directory:
php -S localhost:8000 -t ./php-directory-search-ui-prototype-2020/Then open http://localhost:8000 in your web browser.
User: admin
Password: adminpwd
The application supports both UI-assisted searching (via Radio Buttons) and Advanced Combined Queries directly in the input box:
Select a filter mode in the UI and type your term (the query prefix is applied automatically):
- Dirección (Address - Default): Type any street or location (e.g.,
Manhattan). - Etiqueta (Tag/Note): Type any tag previously assigned to records.
- Orden (Index / Range): Type a single record ID (e.g.,
3) or range (e.g.,1-50). - Persona (Owner Name): Type a person's first or last name.
- Teléfono (Phone): Type matching phone digits.
- Seleccionado(s) Checkbox: Restricts results to previously selected/saved items.
- Regex Support: Enclose your regex pattern strictly between slashes
/pattern/(e.g.,/Manhattan|Queens/).- Note: Trailing flags like
/iare not supported. The pattern must strictly start and end with/. - UI Usage: Select a radio button (e.g., Address or Person) and type
/PatternA|PatternB/.
- Note: Trailing flags like
- Multiple Filters (AND condition): Combine fields using
||in the search box (e.g.,dir:/Manhattan|Queens/||nom:Jose). - Filter Selected Items Only: Append
||$to any query (e.g.,nom:Max||$).
- PHP: 7.4 or 8.x
- Required PHP Extensions:
ext-zip(for CSV chunked exports),ext-iconv,ext-session. - File Permissions: Read & write permissions allowed for
PHP / Web Serveron/b/,/r/, and/d/directories.
/b/- Storage for serialized city database files (grouped by Area/City)./d/- Temporary storage for generated CSV/ZIP export files (auto-deleted upon download)./r/- User credentials store (u.txt)./x/- Core internal processing scripts (search engine, user management, note handlers)./a/- Static assets.
- URI:
/admin.php(alias of/x/manage.php) - Default CFM:
adminadmin
index.php
if(!isset($_SESSION['Q'])){
# ...
# Only ADMIN can enter to '/x/manage.php' (Management UI):
$X['admin'] = ['A' => 'AREA/TEST', 'U' => 'adminname', 'P' => 'adminpwd'];
# .../x/manage.php
# ...
# ADMIN must be signed in and enter the CFM string.
$CFM = 'adminadmin';
# ...$users = [
'user' => ['A' => 'AREA/TEST', 'U' => 'username', 'P' => 'userpwd']
];
file_put_contents('r/u.txt', serialize($users));NOTE: Remember that the r/u.txt is public, so you need to hide this file from public access on server config. And DO NOT EDIT this file manually, it is serialized via serialize & unserialized via unserialize.
session_start();
$_SESSION = ['DB' => [
['1234567890', 'Jose Juan Lee', 'New York Manhattan Queens', 'Prueba 1', 's'],
['0987654321', 'Marco Segundo Jhonson', 'San Francisco City', 'Grupo 2'],
['1231239876', 'Max Hesse Jr.', 'Houston Texas El Dorado', 'Prueba 3', 's'],
['6789321321', 'Jhon Juris Smith', 'Chicago Third Street', 'Grupo 4'],
['9812763454', 'Boris Salazar Durov', 'Los Angeles 8th Street', 'Prueba 5', 's'],
['1298347656', 'Max Power Gonzalez', 'San Diego Far Far Away Avenue', 'Grupo 6']
]];
file_put_contents('./b/AREA/TEST', session_encode());NOTE: DO NOT EDIT these DB files manually, these files are serialized via session_encode & unserialized via session_decode.
Apache (.htaccess inside /r/ and /b/ folders):
Require all deniedNginx (nginx.conf block):
location ~ ^/(r|b)/ {
deny all;
return 404;
}MIT License
Copyright (c) 2020-2026 OKZGN