partial load of a page
Moderator: General Moderators
partial load of a page
i'm looking for a code that loads only a part of a page. I don't know wether it's a php code or another language. but can somebody help.
-
thegreatone2176
- Forum Contributor
- Posts: 102
- Joined: Sun Jul 11, 2004 1:27 pm
i work with an include. i have a mainpage (index.php), in hich i load all other pages. I want now that only the pages that need to be loaded in the index, are being loaded, instead of the entire page, including the index.
here's my site:
www.forumaddict.cjb.net/MacBomas
you'll see what i mean (i hope)
here's my site:
www.forumaddict.cjb.net/MacBomas
you'll see what i mean (i hope)
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
personally, I like to build an array of permitted sites, which usually can be updated via admin panel, but in this case lets create a hardcoded array for the sake of functionality... so..
and then your links should look like index.php?goto=anypage
Code: Select all
#list all permitted files that
$permitted = array('mainpage','lang_eng','someotherpage');
#check if the requested page is in the permitted array
#check if file exists
if (in_array($_GETї'goto'],$permitted) && file_exists($_GETї'goto']))
{
#include the variable 'goto'
include($_GETї'goto'].'php');
}
else
{
#page does not exist
include('404.php');
}that's not what i mean. i use already the script to include pages into my index. but what i'm looking for is a script that only loads this pages, instead of the index + the page.
so when i want to go to register.php, it should only load register.php into my index, instead of loading the index, with the register.php page in it
so when i want to go to register.php, it should only load register.php into my index, instead of loading the index, with the register.php page in it
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
instead of having your links like
http://page.com/?goto=register
do
http://page.com/register.php
Not quite sure what you mean..
http://page.com/?goto=register
do
http://page.com/register.php
Not quite sure what you mean..
i have my index, which cntaisn the links to all the other pages. As you can see on my site, the other pages are being included into my index.
now, i'm looking for a script that only loads the other pages into my index, instead of loading the entire page
so when i hit register, the index should stay visible, and the page inside should change that's all. is there a code for it?
i don't need a code for the include part, i have it already.
i know there are sites who use such script, but i can't find it. maybe it's a javascript, i just don't know
now, i'm looking for a script that only loads the other pages into my index, instead of loading the entire page
so when i hit register, the index should stay visible, and the page inside should change that's all. is there a code for it?
i don't need a code for the include part, i have it already.
i know there are sites who use such script, but i can't find it. maybe it's a javascript, i just don't know