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
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");

}

?>

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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);
?>

Link to comment
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.