Jump to content

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
}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.