Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8886637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:36:22+00:00 2026-06-14T21:36:22+00:00

Let me make it nice and simple: as probably everybody else, I am using

  • 0

Let me make it nice and simple:

as probably everybody else, I am using simple includes on the server for various things such as top menu or a side menu and so on…

Here is my example of code

<?php $number = 1; include("/var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php");?>

the $number =1 defines the correct selection of the tab depending on the page level as usual.

the code that I am including is as follows:

18 <?php $page[$number] = 'selected';?>
19 <!--=================== top navigation ==================-->
20 <nav>
21 <div id="menu">
22 <a href="/Page 1/" class="tab <?php echo $page[1] ?>" title="Page 1">Page 1</a>
23 <a href="/Page 2/" class="tab <?php echo $page[2] ?>" title="Page 2">Page 2</a>
24 <a href="/Page 3/" class="tab <?php echo $page[3] ?>" title="Page 3">Page 3</a>
25 <a href="/Page 4/" class="tab <?php echo $page[4] ?>" title="Page 4">Page 4</a>
26 <a href="/Page 5/" class="tab <?php echo $page[5] ?>" title="Page 5">Page 5</a>
27 <a href="/Page 6/" class="tab <?php echo $page[6] ?>" title="Page 6">Page 6</a>
28 <a href="/Page 3/" class="tab <?php echo $page[7] ?>" title="Page 7">Page 7</a>
29 </div><!-- end .menu -->
30 </nav><!-- end .navigation -->

clearly the css for .selected will change the colour of the background to show that you are on the that particular page so there is no need to explain it.

now the problem, I have just checked my error logs that happened to be pretty large to download and discovered the following errors:

[Sat Nov 24 17:50:50 2012] [error] [client 204.11.33.59] PHP Notice:  Undefined offset:  2 in /var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php on line 23
[Sat Nov 24 17:50:50 2012] [error] [client 204.11.33.59] PHP Notice:  Undefined offset:  3 in /var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php on line 24
[Sat Nov 24 17:50:50 2012] [error] [client 204.11.33.59] PHP Notice:  Undefined offset:  4 in /var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php on line 25
[Sat Nov 24 17:50:50 2012] [error] [client 204.11.33.59] PHP Notice:  Undefined offset:  5 in /var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php on line 26
[Sat Nov 24 17:50:50 2012] [error] [client 204.11.33.59] PHP Notice:  Undefined offset:  6 in /var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php on line 27
[Sat Nov 24 17:50:50 2012] [error] [client 204.11.33.59] PHP Notice:  Undefined offset:  7 in /var/www/vhosts/MyWebSite.com/httpdocs/trial/includes/header.php on line 28

I can not understand the reason for it. IMO if the $number is already predefined than why error?

Please help me to do it the right way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:36:23+00:00Added an answer on June 14, 2026 at 9:36 pm

    The index of $page is not defined. You could change your code like this:

    echo isset($page[1]) ? $page[1] : ""
    //and so on
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a simple menu with a nice transition effect using
One of Googles Let's make the internet faster talks included something about using echo
I apologize if the title sounds abstruse, let me make that simple with an
Is it safe to let users make their own Django templates with a set
In my project I need to write small WYSIWYG editor (just let users make
Before I get anywhere with this post, let me make this clear, there is
I see qCopy , and qCopybackward but neither seems to let me make a
If we want in our WPF application to let a user make a SQL
Let's say I want make some of my sources publicly available via my blog
Let's say I make a Java project in Eclipse that has 3-10 classes and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.