Jump to content

[SOLVED] 2 include on one page...


animefanum

Recommended Posts

I havent been working with php for very long and now I am stuck, I want 2 include on the page, one is for my visual menu and the other is for the news and content. What I want is for the the visual menu just to change when the tabs are clicked but not the news page, unless it was clicked via the main navigation. I am stuck as to how to do this, can some one help me?

 

www.animefanum.co.nr

Link to comment
https://forums.phpfreaks.com/topic/56145-solved-2-include-on-one-page/
Share on other sites

I have no idea what you just said but here is the codes i used.

 

This is the visual php include.

 

<?

$ext = ".php";

$id = "".$visual."".$ext."";

$static = TRUE;

if (file_exists($visual))

{

include($visual);

} else {

include("front.php");

}

?>

 

News and content

<?

$ext = ".php";

$id = "".$id."".$ext."";

$static = TRUE;

if (file_exists($id))

{

include($id);

} else {

include("news/show_new.php");

}

?>

http://animefanum.co.nr/index.php there is my page, i havent opened yet.

 

You can see the tabs, if you click on the graphics tab you can see nothing comes up, i have made sure all the files are in the right folder and they have the right extension and that i have link them properly.

something else strange is happening because the url isn't changing on click your issue is that $visual is not equal to that value you have set

the variable you are placing in the url ?visual=front/graphics is accessible by saying $_GET['visual'] try that, but first you need to see why your links aren't working right. 

try this for your menu area

<?php
if(ISSET($_GET['v']))
{
switch ($_GET['v'])
{
	case graphics:
		$visual = "graphics.html";
	break;
	case video:
		$visual = "video.html";
	break;
	case music:
		$visual = "music.html";
	break;	
	case art:
		$visual = "art.html";
	break;
	default:
		$visual = "default.html";
}
}
else
{
$visual = "default.html";
}
include($visual);
?>

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.