How africandillinger/contact-manager works
Contact Manager is a small PHP web app for registering and logging in, then listing, searching, adding, editing, and deleting contacts. The browser initiates page requests; authenticated contact pages use the shared database connection, while registration and login access user records. The sampled source shows these actions directly in the page scripts rather than in a separate service layer. The delete endpoint does not include the authentication guard used by the other contact pages.
Main entry points: db.php DB connection · index.php Contact list · login.php Login · add.php Add contact
Components 13
Account access
- Register
register.php - Login
login.php - Session guard
includes/auth.php - Logout
logout.php
Contact management
- Contact list
index.php - Add contact
add.php - Edit contact
edit.php - Delete contact
delete.php
Shared infrastructure
- Navigation
includes/navbar.php - DB connection
db.php
Other components
- Browser user
- Contacts table
- Users table
Connections 31
- Browser user → Register: submits
- Browser user → Login: submits
- Browser user → Contact list: requests
- Browser user → Add contact: submits
- Browser user → Edit contact: submits
- Browser user → Delete contact: requests
- Browser user → Logout: requests
- Register → DB connection: includes
- Login → DB connection: includes
- Contact list → DB connection: includes
- Add contact → DB connection: includes
- Edit contact → DB connection: includes
- Delete contact → DB connection: includes
- DB connection → Contacts table: connects
- DB connection → Users table: connects
- Register → Users table: inserts account
- Login → Users table: checks account
- Login → Contact list: redirects on success
- Contact list → Session guard: includes guard
- Add contact → Session guard: includes guard
- Edit contact → Session guard: includes guard
- Session guard → Login: redirects if unauthenticated
- Contact list → Contacts table: searches and reads
- Add contact → Contacts table: inserts contact
- Edit contact → Contacts table: reads and updates
- Delete contact → Contacts table: deletes contact
- Contact list → Navigation: includes navigation
- Add contact → Navigation: includes navigation
- Edit contact → Navigation: includes navigation
- Navigation → Logout: links to
- Logout → Login: redirects to