Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make a dynamic php website with permanent links?
    primarykey
    data
    text
    <p>So i have a problem, I never did this before.</p> <pre><code>I have this website http://82.196.14.71/obrigatorionaover/ . </code></pre> <p>I want to generate ajax webpages but I want permanent links too for the browser history.</p> <p>This is the body of the first page (releituras.php):</p> <pre><code>&lt;body&gt; &lt;?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/obrigatorionaover/php/nav.php"; include_once($path); ?&gt; &lt;div id="float"&gt; //this is a connect &lt;?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/obrigatorionaover/xxxxxxxxxxxx.php"; include_once($path); ?&gt; &lt;?php try { $stmt = $db-&gt;query('SELECT * FROM sessoes ORDER BY id DESC'); while($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) { echo '&lt;div style="background-image:url('."http://localhost:8888/obrigatorionaover/".$row["img"].')" class="rect sessao" id=sessao'.$row["id"].'&gt;'.'&lt;h3 class="titulo"&gt;'.$row["numero_sessao"].'&lt;/h3&gt;'.'&lt;p class="descricao"&gt;'.$row["descricao"].'&lt;/p&gt;'.'&lt;/div&gt;'; } } catch(PDOException $ex) { echo "An Error occured!"; //user friendly message } ?&gt; &lt;/div&gt; &lt;script src="/obrigatorionaover/js/script.js"&gt;&lt;/script&gt; &lt;/body&gt; </code></pre> <p>I clean the div float and insert new content dynamically like this, (sessao.php is similar to the query from releituras.php)</p> <pre><code>function sessao(data){ $("#float").html(""); $.get("/obrigatorionaover/php/sessao.php?id=1").done(function(data) { $("#float").append(data); }); } </code></pre> <p>The url in the browser doesn't change, it is possible to change the url dynamically without changing the content?</p> <p>The browser history doesn't change either (I know I can inject it but i don't have valid physic php page). How can I inject it? Should I create physic php pages automatically when inserting information into the database?</p> <p>Can I have something like virtual php pages? If yes how to do it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload