2 Votes Vote

Change page dynamically

Posted by topdog 469 days ago Questions| page html change All
<?php

  $go = $_GET['go'];


  if(!empty($go)) {

    if(is_file("page/$go.html")) include "page/$go.html";

    else echo "<h1>Error 404</h1><p>Strona nie odnaleziona</p><p>Warunek ?go jest niepoprawny</p>";
  }

  else include "page/start.html";

  ?>
<script>
$.get('go', function(change) {
  $('#center').load('page/<?php echo $go ?>.html');
});
</script>

I have somethng like this but it doesn't work. I just want that the page which is loaded (?go=name) won't refresh whole page

Originally asked by: arekPL on Stack Overflow

Discuss Bury


Who Voted for this Question