Jump to content

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

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.