Jump to content

[SOLVED] Menu Question


daebat

Recommended Posts

Thanks,  I'm having a few problems that maybe you can help me with:

 

I've set up links.php and include it in index.php. 

 

I set my menu links to index.php?page=1 (2,3,4,5, etc.)

 

Now I'm confused as to where I should put

<?php require("links.php"); ?>

 

I tried setting it in index.php under the menu include and it gives me errors.

 

I put it in the content page itself and it gives me a fatal error: exhausted memory...

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/176960-solved-menu-question/#findComment-933074
Share on other sites

links.php

<?php
switch($pageid)
{

case "1": include('fscorplogo.php');
break;
case "2": include('brandlogos.php');
break;
case "3": include('brandlogos.php');
break;

default: include('home.php');
}
?>

 

index.php

</head>

<body>
<?php
include ("includes/header.php");
?>

<?php
include ("includes/menu.php");
?>

<?php
include ("includes/links.php");
?>


<?php
include ("includes/footer.php");
?>

</body></html>

 

menu.php

<div id="menu">
<h3 style="cursor: pointer;" onclick="expandcontent('sc1')">LOGO CATALOG</h3>
<div id="sc1" class="switchcontent" style="display: none;">
<a href="index.php?page=1">FS CORPORATE LOGO</a>
<br/>
<a href="index.php?page=2">BRAND LOGOS</a>
</div>
</div>

 

So my question is where should I be placing

<?php require("links.php"); ?>

 

Link to comment
https://forums.phpfreaks.com/topic/176960-solved-menu-question/#findComment-933085
Share on other sites

Hi daebat,

 

I've just read through that tutorial and it's not particularly clear, for example swicth($pageId) is not going to work, it needs to be something like switch($_GET['page']).

 

The include is fine where it is in the index.php page, give the above edit a go and see what happens.

 

Hope this helps.

Link to comment
https://forums.phpfreaks.com/topic/176960-solved-menu-question/#findComment-933100
Share on other sites

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.