PDA

View Full Version : php help, 2 conflicts


ViciousCode
03-25-2009, 03:53 PM
Hello, I need help with this!

If i add this code on top.
<?php
$curdir = getcwd ();
chdir('forums');
require_once('global.php');
chdir ($curdir);
?>then this code wont work, the pages/content wont change, please help

<?php

//Include page header
include('header.php');

//Get the page variable
$page = $_GET['page'];

//Our switch statement to get the right content
switch($page) {
case "home": //For each page of content just add a case block
$content = "home.php"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.

case "news":
$content = "news.php";
break;

case "biography":
$content = "about-atb.php";
break;

case "album":
$content = "album.php";
break;

case "media":
$content = "media.php";
break;

case "interact":
$content = "interact.php";
break;

case "contact":
$content = "contact.php";
break;

case "blog":
$content = "blog.php";
break;


default: //If the variable didn't match any of the above cases do this.
$content = "home.php";
break;
}

//Include the selected content.
include($content);

//Include page footer
include('footer.php');

?>

Lynne
03-25-2009, 04:13 PM
See these threads on how to create a new page in vb - How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

ViciousCode
03-25-2009, 05:22 PM
im trying to integrate the forum into the website.

thats why im using the content switch to change the content.

Marco van Herwaarden
03-26-2009, 10:28 AM
Use the vB input cleaner to access variables like $_GET[page].