Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RewriteEngine on
- Options +FollowSymlinks
- RewriteBase /
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)/$ /benc/$1 [L,R]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^.*$ /benc/index.php [L,QSA];
- function showBlogs($limit) {
- global $conn;
- $result = mysqli_query($conn, "SELECT a.*, b.* FROM blogs a, slugs b WHERE b.blogID = a.idBlog");
- while ($row = mysqli_fetch_array($result)) {
- echo '<div class="container_blogs" id="' . $row['idBlog'] . '">';
- echo '<h1 class="title_blog">' . $row['title'] . '</h1>';
- echo '<h3 class="desc_blog">' . $row['blogDesc'] . '</h3>';
- echo '<p class="text_blog">' . $row['content'] . '</p>';
- echo '<div class="link_container"><a href="http://localhost:8080/benc/' . $row['slug'] . '">' . "Read more" . '</a></div>';
- echo '</div>';
- }
- }
- global $conn;
- define("SYSTEMNAME","TENPCMS1.0");
- //include files after defining slug, there's a check to prevent direct execution of php files.
- // include_once('template.php');
- include_once('database.php');
- // include_once('fetch_mysql.php');
- $root = '/benc/';
- //de root moet straks worden opgehaald uit mysql
- $url = $_SERVER['REQUEST_URI'];
- $slug = str_replace($root,"",$url);
- define("SLUG", $slug);
- define("DOMAIN", $_SERVER['HTTP_HOST']);
- if(SLUG == NULL ){
- function showBlog() {
- ?>
- <h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.
- Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes,
- nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</h1>
- <a href="#"><i class="fas fa-angle-right"></i> Nieuwe Website</a>
- <?php
- }
- }
- else {
- function showBlog() {
- global $conn;
- global $slug;
- $slugs = "SELECT a.* FROM blogs a, slugs b WHERE a.idBlog=b.blogId AND b.slug='$slug'";
- // $slug = "SELECT * FROM blogs WHERE idBlog = $slugs";
- $result = $conn->query($slugs);
- while ($row = mysqli_fetch_array($result)) {
- echo '<div class="container_blogs">';
- echo '<div class="blog_container_p" id="' . $row['idBlog'] . '">';
- echo '<h1 class="blog_title_p">' . $row['title'] . '</h1>';
- echo '<h3 class="blog_desc_p">' . $row['blogDesc'] . '</h3>';
- echo '<p class="blog_text_p">' . $row['content'] . '</p>';
- echo '</div>';
- echo '</div>';
- }
- }
- }
- include_once('template.php');
Add Comment
Please, Sign In to add comment