Jump to content

Page not calling correctly


FleshCoat

Recommended Posts

So i am useing PHP & Jquery to call unpon pages in a subfolder to present it'self into my main content space. It works correctly when i just have it calling "#Page1,2,3,4" #Page with numbers after it, but that would get very confuseing if i had many pages. I want to make it so that i can use "#faq1,2,3,4" also with the "#page1,2,3,4" to call seperate pages, to give them a specific catagory so i wont get confused by my own websites page contents.

 

Here is the code i am useing.

 

<?php

if(!$_POST['page']) die("0");


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


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

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

?>

 

So, my question is. How do i tweek this php coding to allow me to also use "#faq" or any other word i wish in its place to be used.. but also open up in my main area!? Thank you in advance for the replys.

Link to comment
https://forums.phpfreaks.com/topic/246931-page-not-calling-correctly/
Share on other sites

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.