Hello.
There was a problem, it is not possible to use the GET request in this part of the code (when you click on the link, it should be translated to the site.ru/lesson.php?id=1 page, but opens the error page (ie, the not_found () function is turned on))
$query = mysqli_query($connect, "SELECT * FROM `lessons` WHERE `teachid` = '".$_SESSION['id']."' "); while ($row = mysqli_fetch_assoc($query)) { $haslesson = TRUE; echo " <br> <a href='lesson.php?id=".$row['id']."'><p>".$row['title']."</p></a><br> "; } As I myself assume, most likely it's in .htaccess, or in my index.php
.htaccess:
AddDefaultCharset utf-8 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] The part of the index.php code in which you also need to fix something
if($_SERVER['REQUEST_URI'] == '/') $page ='home'; else { $page = substr($_SERVER['REQUEST_URI'], 1); if(!preg_match('/^[A-z0-9]{3,40}$/', $page) ) not_found(); } $connect = mysqli_connect('localhost', 'root', '', 'qschool'); if (!$connect) { exit('MySQL error'); } session_start(); if ( file_exists('all/'.$page.'.php')) include 'all/'.$page.'.php'; else if ( $_SESSION['id'] and file_exists('auth/'.$page.'.php')) include 'auth/'.$page.'.php'; else if ( !$_SESSION['id'] and file_exists('guest/'.$page.'.php')) include 'guest/'.$page.'.php'; else not_found(); I know that there are plenty of such questions here, but all my attempts were in vain.
I hope for help. thank
PS I'm almost sure that you need to change the preg_match and add something to .htaccess
sq- Farkhod Daniyarov