0

Hello, I am supernew at php.
I understand Javascript, some intermediate Java, expert html, css, Actionscript.
Please advise as to the issue below.

My company has acquired a php-based Web site.
It has a button in the global main navigation header that we need to remove.
Here is the following script that the php page header.inc pulls to populate the global navigation header:

$navigation = @mysql_query("SELECT * FROM navigation WHERE category='main' ORDER BY listing ASC");

Which is then placed into a table by this code:

<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tr> 
	  <td><img src="/_images/nav_divider_white.gif"></td>
	  
	  <?php while ($nav = @mysql_fetch_array($navigation)) { ?>
	  <td class="<?php
	  
	  	if ($mainNav == "kb") {
			$mainNav2 = "support";
		} elseif ($mainNav == "markets") {
			$mainNav2 = "home";
		} else {
			$mainNav2 = $mainNav;
		}

		if ($mainNav2 == strtolower($nav['title'])){
			echo "nav_main_on";
		} else {
			echo "nav_main";
		}
	  ?>"><a href="<?= $nav['url']; ?>"><?= $nav['title']; ?></a></td>
	  
	  <td><img src="/_images/nav_divider_white.gif"></td>
	  <?php } ?>
	</tr>
</table>

I need to remove a button named "company"
I updated the table code as follows:

<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tr> 
	  <td><img src="/_images/nav_divider_white.gif"></td>
	  
	  <?php while ($nav = @mysql_fetch_array($navigation)) { 
              if ($mainNav == "company") {
              continue;
              }
          ?>

... remaining original code, etc. ...

Instead of removing the button from the navigation bar, it removes the navigation bar from the page "company" which I thought was interesting but not the achievement I wanted. :)

Thank you in advance!

Edited by Eworsley: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Eworsley
0

Try:

<table border="0" align="center" cellpadding="0" cellspacing="0">
	<tr> 
	  <td><img src="/_images/nav_divider_white.gif"></td>
	  
	  <?php while ($nav = @mysql_fetch_assoc($navigation)) { 
              if ($nav['fieldname'] == "company") {
              continue;
              }
          ?>

... remaining original code, etc. ...

...Replacing with the name of the mysql fieldname that company is located. Also, I can't see where $mainnav and $mainnav2 are coming from

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.