while ($row = $result->fetch_assoc()) { $data[] = $row; } return $data; } } if ($_POST["action"] == "addLink") { $link = $_POST["link"]; $text = $_POST["text"]; $text = htmlentities($text, null, "UTF-8"); $link = htmlentities($link, null, "UTF-8"); $link = str_replace("http:", "", $link); $link = str_replace("//", "", $link); $link = str_replace("www.", "", $link); $link = Database::mres($link); $text = Database::mres($text); Database::execute("INSERT INTO links(name,link) VALUES('{$text}','{$link}')"); } $data = Database::getList("SELECT name,link FROM links ORDER BY id DESC LIMIT 10"); ?> <!DOCTYPE> <html> <head> <title>PostTheLink</title> <meta name="viewport" content="width=device-width"> </head> <body> <div class="wrapper"> <div class="title_header"> <h1>PostTheLink</h1> <p>Тут вы можете оставить ссылку и подпись к ней</p>