have 2 problem in my index page

issue 1
have created a menu header - It is confirmed valid and can be use but the thing is, when ever i go back to home link - index page from other page, all the links is disable to be click but it is visible to user.

issue 2
queries from database is not working on the index page. but when i try to make other page it was okey.

have been scratching head to search for the possibilities of this error.
Can anyone give tips or suggestion on the error above?

Recommended Answers

All 8 Replies

No it cannot be .Might be,you are using a separate file for database connection and in your index file you are missing to include that file.

for the header menu, is come from one file.
only not working on the index page.

database connection also confirm its correct.
don't know what went wrong

Rather than guessing all day about what it could be, it would be better for you to post your code so it can be seen.

this is the code for the query

$que= "select bulletsub, bulletdesc, date_format(t1.datekeyin, '%e-%c-%Y') datekeyin,    departmentdesc from bulletineboard t1 INNER JOIN sdir t2 on t2.staffid = t1.keyinby  left join department t3 on t2.department = t3.deptid where DATE(bulletexpire) >= DATE(NOW()) and bulletstat != 0 order by bulletexpire desc ";

    $res = mysql_query($que) or die ('Error: '.mysql_error());
    $bi =1;
    $num_ro = mysql_num_rows($res);

    echo $que . "<br>";
    echo $num_ro ;
    if ($num_ro !=0) {
    echo "<br>got<br>";
    while($ro=mysql_fetch_assoc($res))
    {
        echo "in<br>";
    }   
    }

i try to run this query at different page with same database connection it won't work.

for the header code as below

 <div id="staffname">
   </div>
 <div id="header">
 <div id="topbar">
   <div id="topnavLeft">
    <a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/index.php" title="Home"> <img src="<? $_SERVER['REQUEST_URI']; ?>/intranet/img/icon_home.png"/></a>
    <a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/dir/index.php" title="Staff Directory"> <img src="<? $_SERVER['REQUEST_URI']; ?>/intranet/img/icon_phonebook.png" /></a>
    <a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/cal/leavecalendar.php" title="Leave Calendar" target="_new"> <img src="<? $_SERVER['REQUEST_URI']; ?>/intranet/img/icon_calendar.png"></a>
    </div>
    <br class="clear" />
  </div>
    <div class="fl_left">
     <img src="<? $_SERVER['REQUEST_URI']; ?>/intranet/images/PPSB-Logo.jpg">
    </div>
    <div class="fl_right"><a href="#"><img src="<? $_SERVER['REQUEST_URI']; ?>/intranet/images/subsidiaries.png" alt="" /></a></div>
    <br class="clear" />
  </div>
  <? if ($AUID !="") {
  ?>

   <div id="topnav">
      <ul>
            <li><a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/dir/">H. R. M</a>
            <ul>
                <li><a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/dir/">e-Staff Directory</a></li>
                    <section style="text-indent:15px;">
                        <li><a href="/intranet/hrm/diradd.php">Add New Staff</a></li>
                        <li><a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/hrm/dirlist.php">List/ Edit</a></li>
                    </section>
                <li><a href="#">e-Leave</a></li>
                     <section style="text-indent:15px;">
                        <li><a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/hrm/statistic.php">Leave Statistic</a></li>
                     </section>
             </ul >
            <li><a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/forms/">Offline Forms</a></li>

        <li><a href="<? $_SERVER['REQUEST_URI']; ?>/intranet/logout.php">Logout</a></li>
      </ul>
    </div>
 <? } ?>
  • when ever i clicked the home button from the topbar section, all the links is disable.

For your links:
You're using $_SERVER['REQUEST_URI']; which outputs the complete URI of the request after the domain name (example: "/folder/folder/index.php"). I am sure you are trying to just get the current domain name that the script is running on, right?

If yes, then you should be using $_SERVER['SERVER_NAME'];

For the query:
I don't see any reason from this code that would change it's behavior based on what page it is run from. There must be a problem elsewhere in your setup that is the cause of the problem, so we would need some more information about that.

thankx, i don't think so it's problem with the link because the menu links activate again once i clicked the Staff Directory page on the topbar only deactivate once the home button clicked :(
btw, i try to change to $_SERVER['SERVER_NAME'] also same.

what kind of info that might need?

i'm using xampp

the index file is at the main folder
as for others, it is inside folder/folder/

I've tried to create a newpage at the main folder using the data query, there are data exist. only at index page return 0

How are you including the header (and your other files like the db connection) on the pages?

Like what IIM was sort of touching on, it really sounds like a different header file is being included or something. When you go to the page with the links deactivated, check the source of the page to see that they are actually set as links still.

When i scroll over the menu .. and see at the status bar the links change just that could not be clicked

database connection i used

require_once('includes/db_con.php'); 

header page is

 require_once('header.php'); 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.