Hello! I installed the library via composer and then connected it using autoload to my router. Next, I tried to use it in the file where I add articles to the site, but I got:
Fatal error: Uncaught Error: Class "simple_html_dom\simple_html_dom" not found in C:\OSPanel\domains\localhost\php\classes\Blog.php:15
Stack trace:
#0 C:\OSPanel\domains\localhost\router.php(29): classes\Blog::handlerAddArticle()
#1 C:\OSPanel\domains\localhost\php\classes\Route.php(24): {closure}()
#2 C:\OSPanel\domains\localhost\router.php(29): Route::post()
#3 {main}
thrown in C:\OSPanel\domains\localhost\php\classes\Blog.php on line 15
switch (true) {
case(empty($title) && empty($content)):
return json_encode(['result' => 'error']);
case(empty($title)):
return json_encode(['result' => 'errorTitle']);
case(empty($content)):
return json_encode(['result' => 'errorText']);
default:
$mysqli->query("INSERT INTO articles(title, content, author) VALUES ('$title', '$content', '$author')");
return json_encode(['result' => 'success']);
}
}