We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Menu Question

NTGrE
NTGrE asked
on
Medium Priority
331 Views
Last Modified: 2010-04-09
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
Comment
Watch Question

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>

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.