Jump to content


Photo

Can someone help me make this work?:( I've done everything I can think of


  • Please log in to reply
4 replies to this topic

#1 linstefoo

linstefoo
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 10 August 2006 - 05:42 PM

I've got a question on how to make somthing work. I've got the following code:
<?
   $navigation_menu['top']['Home']['url'] = "index.html"
?>

and then I got this code which outputs the menus
<?
  foreach($navigation_menu['top'] as $name => $link) {
   echo "<a href=\"{$link['url']}\">{$name}</a>";
  }
?>

how do i get the following to work in coordination wiht the above and load the pages dynamically:
<?
   if(is_array($VirtualPage)) 
     echo $VirtualPage['content'];
   elseif(file_exists("include/$Page.php");
     include("include/$Page.php");
?>


#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 10 August 2006 - 06:36 PM

How can you make them work without even knowing how to format them correctly, change them to this.

<?php
   $navigation_menu['top']['Home']['url'] = "index.html"
?>
<?php
  foreach ($navigation_menu['top'] as $name => $link) {
   echo "<a href=\"{$link[url]}\">{$name}[/url]";
  }
?>
<?php
   if (is_array($VirtualPage)) {
     echo $VirtualPage['content'];
   }elseif (file_exists("include/$Page.php") {
     include 'include/{$Page}.php';
  }
?>
Now that I can actually ready it
what do you want it to do in cordination with the above?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 linstefoo

linstefoo
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 10 August 2006 - 06:40 PM

I basically need the last chunck of code to read {$link['url']} and if it finds a file called index.php inside the include file load it for the index.php on the hompage. Else if the user clicks another link like "about us" it checks to see if an aboutus.php file exists in the Inlucde directory and loads it via the INCLUDE function.

#4 linstefoo

linstefoo
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 10 August 2006 - 09:36 PM

can anyone help me with this? I really need to get this working

#5 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 10 August 2006 - 10:23 PM

try
<?php
$navigation_menu['top']['Home']['url'] = "index";
foreach ($navigation_menu['top'] as $name => $link) echo "<a href=\"?page={$link[url]}\">{$name}</a>";
$Page=$_GET['page'];
if (file_exists("include/$Page.php")) include "include/$Page.php";
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users