Chrisj Posted March 18, 2010 Share Posted March 18, 2010 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 More sharing options...
trq Posted March 18, 2010 Share Posted March 18, 2010 Nothing to do with php. You want to rewrite url's from http://www.webexample.com/newpage to http://www.webexample.com/page.php?page=12. There should be plenty of examples of how this is done within the mod_rewrite board. Link to comment https://forums.phpfreaks.com/topic/195637-adding-a-page-to-this-php-script/#findComment-1027950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.