Menu Question

Posted on 2006-03-24
Last Modified: 2010-04-09

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">
    <td bgcolor="#999999"><div align="center">Menu</div></td>
    <td bordercolor="#FF0000" bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=homebody">Home</a></div></td>
    <td bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=register">Register</a></div></td>
    <td bgcolor="#CCCCCC"><div align="center"><a href="index1.php?page=search">Search</a></div></td>

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

if (isset($_GET['page'])) {
  if (in_array($page,array('home','register','search'))) {
else {
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
and when i search for a keyword ex----> italo

Any idea HOW to solve this????

Thnx for your time
Question by:NTGrE
    1 Comment
    LVL 7

    Accepted Solution

    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>


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
    Introduction This warning has to be one of the most commonly issued warnings in the history of PHP.  The article explains why this warning arises and what to do to mitigate the problem. How this Happens HTTP headers include many different kinds…
    In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
    In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now