Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lukgol26's avatar

PHP to Begginers. Dont working About and Contack page

I didnt found departament for php so i writing it here. The problem is that:

  1. I have cloned repository for PHP for begginers through git clone
  2. git checkout fb07ea5
  3. i have cloned it to htdocs on xampp. i use windows11
  4. i have opened index.php it shows me "array(2) { [0]=> array(2) { ["id"]=> int(1) ["name"]=> string(2) "xD" } [1]=> array(2) { ["id"]=> int(2) ["name"]=> string(2) ":D" } }" 4.1) i have commented "dd($posts);" and uncommented "require 'router.php';"
  5. when i clicled "Home" it sends me to "http://localhost/dashboard/" thats is Xampp page but when i clicking about or contack it shows me "Not Found The requested URL was not found on this server.

Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at localhost Port 80"

6)my fix for that was in router.php "$routes = [ '/PHP-For-Beginners-Series/' => 'controllers/index.php', 'PHP-For-Beginners-Series/about' => 'controllers/about.php', '/PHP-For-Beginners-Series/contact' => 'controllers/contact.php', ];" and in views/partials/nav.php on line 9 to 14

                    href="/PHP-For-Beginners-Series/" class="<?= urlIs('/') ? 'bg-gray-900 text-white' : 'text-gray-300' hover:bg-gray-700 px-3 py-2 rounded-md text-sm font-medium">Home
                    href="/PHP-For-Beginners-Series/about" class="<?= urlIs('/about') ? 'bg-gray-900 text-white' : 'text-gray-300' ?> hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">About
                     href="/PHP-For-Beginners-Series/contact" class="<?= urlIs('/contact') ? 'bg-gray-900 text-white' : 'text-gray-300' ?> hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium">Contact
                "

and Home works just fine but About and Concact does not work and shows me "Not Found The requested URL was not found on this server.

Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at localhost Port 80"

Any one knows how to fix that?

If it is wrong departamend please tell what departamend is ok for this question.

0 likes
6 replies
lukgol26's avatar

I have found the solution. Solution is that "urlIs" function does not exist. This function is in views/partials/nav.php on line 11,12,13. i was looking for this for 2 whole days. xD

lukgol26's avatar

i forgot that you need also .htaccess file.

gych's avatar

Good that you managed to find the issue! :) Please don't forget to close your thread by selecting your solution as best answer.

lukgol26's avatar

What do when i have 3 solutions for fix this issue?

gych's avatar

@lukgol26 In your first reply you stated that you found the solution:

have found the solution. Solution is that "urlIs" function does not exist

Therefore it seems that your issue/question has been solved, which is why I asked you to close your thread by selecting the best answer.

lukgol26's avatar
lukgol26
OP
Best Answer
Level 3

Solution is concluded in the whole thread. Read from beggining to end.

Please or to participate in this conversation.