Jump to content

How to prevent a whole page refresh


erezki

Recommended Posts

Hey,

I built a site in PHP.

All the site is working with the same URL, which is rachelkinarti.com.

My paging is done with forms that sends the submit info to the same index.php script.

The problem is that every time a user is changing the page (via the main menu or other ways), all the page is refreshed (dissapear for a while and appears again with the new page), even though most of the page is unchanged.

Does anybody know what can cause that problem (maybe caching issues?) and how can I solve it?

Thanks in advance,

Erez

 

Link to comment
https://forums.phpfreaks.com/topic/74439-how-to-prevent-a-whole-page-refresh/
Share on other sites

the browser obviously has to reload the new page. What you could do, is in the middle area (The content area), put a switch code. However, this would mean your URL would be http://rachelkinarti.com/?page1

 

<?php

switch($_SERVER['QUERY_STRING']) {

// For each page you want, put a block like this
case 'page1': // Whatever you want after the /?
include('pages/page1.php'); // The page to include
break;

// And, the default page...
default:
include('pages/main.inc'); // Home Page include
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.