Jump to content

Adding a page to this php script


Chrisj

Recommended Posts

I'm using an existing php script. In this script you need to add code to page.php in order to add a web page. But when you add a page, the browser shoes something like this, for example:

http://www.webexample.com/page.php?page=12

 

I'd like to add a page that looks something like this instead:

http://www.webexample.com/newpage

 

Can you help me? Here is the existing code of page.php:

 

<?php
include_once ("classes/config.php");
include_once ('classes/menu.php');
include_once ('classes/sessions.php');

$page = $_GET['page'];

//use this script to load various generic pages  (e.g. about us, terms etc)

switch ($page){

case 1:
$which_page = 'generic_aboutus.htm';
break;

case 2:
    $which_page = 'generic_contactus.htm';
    break;
    
    case 3:
    $which_page = 'generic_terms.htm';
    break;
    
    default:
    header( 'Location: index.php' ) ;
    break;
    }
    
//START-----------------------
$template = "templates/main.htm";
$inner_template1 = "templates/$which_page";//middle of page
$TBS = new clsTinyButStrong;
$TBS->NoErr = true;// no more error message displayed.
$TBS->LoadTemplate("$template");
$TBS->MergeBlock('mp', $recent);
$TBS->MergeBlock('blkfeatured', $result_featured);
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die();
?>

Link to comment
https://forums.phpfreaks.com/topic/195637-adding-a-page-to-this-php-script/
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.