Page access link

-1

How do I when to click on the example products link, just change example content and leave header and footer quetos? do with Slin and Rain frameworks, HELP !!!.

    
asked by anonymous 06.07.2017 / 03:39

2 answers

2

You can use PHP for this:

For example

<section class="section">
  <div class="container">
  <?php
  $url = (isset($_GET['url'])) ? $_GET['url'] : 'login';
  $url = array_filter(explode('/', $url));

  $file = './pages/' . $url[0] . '.php';

  if (is_file($file)) {
    require_once $file;
  } else {
    require_once './pages/404.php';
  }
  ?>
  </div>
</section>

Where you will also need a htaccess :

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^(.*)$ index.php?url=$1 [QSA]
What this code basically does is call the file php within the pages folder indicated in url : exemplo.com/contatos without .php at the end if the page exists it is included if not it returns the page 404.php

    
06.07.2017 / 10:12
0

You can dynamically load product properties through ajax or use a front-end framework. The easiest way is to load the data dynamically through ajax, since you do not learn a framework overnight, and if you use it badly, you're short on time.

    
06.07.2017 / 10:07