• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 318
  • Last Modified:

Menu Question

Hello.

I m trying to build a basic page that uses this as menu..

<table width="120" height="100" border="3" cellpadding="1" cellspacing="3" bordercolor="#FF0000" bgcolor="#00FF00">
  <tr>
    <td bgcolor="#999999"><div align="center">Menu</div></td>
  </tr>
  <tr>
    <td bordercolor="#FF0000" bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=homebody">Home</a></div></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=register">Register</a></div></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=search">Search</a></div></td>
  </tr>

and in my index i m using this to display each selected page in the body..

<?php
if (isset($_GET['page'])) {
  if (in_array($page,array('home','register','search'))) {
  $page=$_GET['page'];
  }
}
else {
$page='home';
}
include ("$page.php");


Everything seems that working fine but when i m in my search page and i search for a keyword i m taking this error

Warning: main(home.php) [function.main]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\vilyl\Templates\index1.php on line 30

Warning: main() [function.include]: Failed opening 'home.php' for inclusion (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\vilyl\Templates\index1.php on line 30

where line 30 ==> include ("$page.php");

When i first open my searchALL.php page in my browsers adress bar displayed
http://localhost/vilyl/Templates/index1.php?page=search
and when i search for a keyword ex----> italo
http://localhost/vilyl/Templates/index1.php?search=italo&search_mode=normal&search_cat=all&search_order1=enddate&search_order2=ASC

Any idea HOW to solve this????

Thnx for your time
0
NTGrE
Asked:
NTGrE
1 Solution
 
bubbledragonCommented:
Hey, "homebody.php" and "home.php" are different page? Maybe you only a homebody.php, so you get the error.

<td bordercolor="#FF0000" bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=homebody">Home</a></div></td>

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now