DEV Community

Cover image for PHP Phone Book
ramoures
ramoures

Posted on • Edited on • Originally published at github.com

17

PHP Phone Book

php phonebook admin panel


Demo

UTC Timezone

username: admin
password: 123

Setup

  • 1.Clone or download: GitHub Repository
  • 2.Create a new MySQL database.
  • 3.Set your database information and your PROJECT_URL in config.php.
  • 4 & 5:
  • 4.Browse /setup to create the required tables and admin sign up.

Ex. https://localhost/PHP-Phone-Book/setup/

  • 5.Remove /setup directory.

OR

  • 4. Remove /setup directory.
  • 5. IMPORT php_phone_book.sql to your database table.

The username added after import is: admin , password: 123

  • 6.Set media directory permission to 777.

    sudo chmod -R 777 media


Requirement

  • Apache HTTP web server.
  • MySQL database
  • PHP ^8.2.4
  • Apache module mod-rewrite must be enabled.
  • mysqli, mysqlnd, pdo ,pdo_mysql PHP extensions must be enabled.

To check the above: <?php phpinfo(); ?> - PHPInfo

  • allowOverride must be set to All in the Apache configuration file.

Information

  • HTTP Server: Apache
  • Programming language: PHP 8.2.4
  • Programming paradigm: OOP
  • Architectural patterns: MVC
  • Template engine: TWIG 3.0
  • Database: MySQL
  • Licensed under MIT

I used:

  • URL Routing methods.
  • TWIG template engine.
  • PDO & Prepared Statements MySQL Connection.
  • Singleton design patterns for some required classes.
  • Multi language suppourt.
  • Many options for configuration. config.php
  • Sorting and pagination of items.
  • Client and server side captcha for sign in form.

    Optional config: Google reCaptcha or Cloudflare Turnstile

  • Errors handling method.

  • Bootstrap and jQuery.


HELP

Solutions

Enable the apache module mod_rewrite

$ sudo a2enmod rewrite

Set config allowOverride All

Edit the Apache config file:

$ cd /etc/apache2

$ sudo nano apache2.conf

Find:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
Enter fullscreen mode Exit fullscreen mode

And change it to:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
Enter fullscreen mode Exit fullscreen mode

/var/www/ : your root directory.

Press Ctrl + o (for save), then Ctrl + x (for exit).

Then,

$ sudo systemctl restart apache2

Apache mod_rewrite module


Add new language

  1. Create your language file in the lang folder.

Ex. fr.php or ar.php and develop similar to lang/fa.php.

  1. Add your new language for frontend pages.
<!-- Example: -->
<div class="changeLanguage">
     <button id="fr">Fr</button>
     <button id="en">En</button>
</div>
<!-- Look at: .changeLanguage click function on view/assets/js/app.js or backend.js  -->
Enter fullscreen mode Exit fullscreen mode

E-Mail: ramoures@gmail.com

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (6)

Collapse
 
blossom profile image
Blossom Babs

This is such a fun project

Collapse
 
cyberfiducia profile image
CyberFiducia

Well done. Just checked this out. Clean and simple.

Collapse
 
rassul_gahramanzadeh_88ec profile image
Rassul Gahramanzadeh
Comment hidden by post author
Collapse
 
ramoures profile image
ramoures

درود. موارد را بررسی و ایرادهای احتمالی را برطرف خواهم کرد. سپاس برای دانلود، بررسی و گزارش ایراد⚘️

Collapse
 
rassul_gahramanzadeh_88ec profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct

ممنونم از توجه شما
azarvitrin.ir/professor/PHP-Phone-...

می توانید از این ادرس موارد را چک بفرمایید و حتما اطلاع بدید که من هم اصلاح کنم
باز ممنون از پروژه زیبای شما

Thread Thread
 
ramoures profile image
ramoures • Edited

مواردی که اشاره کرده بودید را بررسی کردم و ایرادی در برنامه مشاهده نکردم.
باید در روند انتقال برنامه به سرویس خودتان و نحوه‌ی راه‌اندازی شما اشتباهی رخ داده باشد.
ایراد را در مورد زیر بیابید:

در لینکی که فرستاده‌اید فایلهای جاوااسکریپت موجود در پوشه‌ی مسیر:
view/assets/js
خوانده نمی‌شوند و با خطای ۴۰۳ مواجه هستند. همین مساله باعث تمام مشکلاتی است که ذکر کرده بودید.

Image description

سپاس

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay