View Full Version : Help Calling Pages

09-11-2011, 08:51 PM
if(!$_POST['page']) die("0");

$page = (int)$_POST['page'];

echo file_get_contents('pages/page_'.$page.'.php');

else echo 'Page does not exist! Go back!';

Ok, so the code i displayed will fetch the file "page_1,2,3,4" from the folder. When i go to use "#pagefaq" it will not fetch it. I have to use a number for it to fetch the page. ex: "#page1". I want/and am trying to code another type of php line like the one for "page" but instead i want it to use "faq" so i can have a seperate linking system to keep the pages in order. I am still working on the problem right now, but i am not sure how to go about it correctly, so im kind of trial and erroring as i go along, seeing if random things i think of work. So far, no luck. Can anyone help me?

09-11-2011, 09:09 PM
If I understand you're description properly, you're tying to read out the portion of a page which has an anchor. file_get_contents won't do that I'm afraid. It will read out the entire file only.

It isn't a browser like IE, FF etc so it doesn't understand html anchors - it just see's file text and an end of file marker.

09-11-2011, 09:29 PM
Yes, it's anchored to the main area of which i want all content to be displayed. That works fine. When i use the "#page1" making links, it links perfectly fine! But when i try to use something like "#pagefaq" so i can get a specific name for a page to keep the order of the pages so i know specifically what they are. But it wont let me do anything but "#page[some random number]". So i wanted to know how to add in another php code in the one i displayed so that i could properly call upon "#faq1" as well as "#page1" and have them display in the same area.

I have a seperate page of jquery coding helping it display in my main area also.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum