Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Odd Error

I get this error.

Parse error: syntax error, unexpected '<' in /homepages/22/d203631705/htdocs/servicetechnow/menu.php on line 2

See attached for menu.php.

It is included using <? include "menu.php"; ?> in the program.

What's wrong?
menu.php
ASKER CERTIFIED SOLUTION
Avatar of WebDevEM
WebDevEM
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, and you could also simplify that Manage Client link a little if you wanted to:
<ul id="nav" class="drop">
  <li><a href="#">About</a></li>
  <li>Work Orders
    <ul>
      <li><a href="task_builder.php">New Workorder</a></li>
      <li><a href="manage_wos.php">Manage Existing Workorders</a></li>
    </ul>
  </li>
  <li>Set Up
	<ul>
      <?php
	     if ($_SESSION['cid'] == 0) { 
		    echo '<li><a href="manage_clients">Manage Clients</li>';
	     }
        ?>	
		<li><a href="set_up.php">System Setup</a></li>
		<li><a href="manage_users.php">Manage Users</a></li>
   </ul>
  </li>		
  <li><a href="manage_parts.php">Parts</a></li>
	<li><a href="manage_tasks.php">Tasks</a></li>
	<li><a href="#">Export/ Report</a></li>
	<li><a href="#">What&#39s New</a></li>
	<li><a href="#">Help</a></li>
	</ul><br><br>

Open in new window

include() is a PHP function.  Check the man page.

The first two lines of the script say this

<?php
<ul id="nav" class="drop">

Open in new window


<ul is not a PHP statement.  You might want to use echo or similar to write the HTML.

Here is how I might try it.
<?php
$y = NULL;
if ($_SESSION['cid'] == 0)$y = '<li><a href="manage_clients">Manage Clients</li>'

$x = <<<EOD
<ul id="nav" class="drop">
  <li><a href="#">About</a></li>
  <li>Work Orders
    <ul>
      <li><a href="task_builder.php">New Workorder</a></li>
      <li><a href="manage_wos.php">Manage Existing Workorders</a></li>
    </ul>
  </li>
  <li>Set Up
	<ul>
		$y	
		<li><a href="set_up.php">System Setup</a></li>
		<li><a href="manage_users.php">Manage Users</a></li>
   </ul>
  </li>		
  <li><a href="manage_parts.php">Parts</a></li>
	<li><a href="manage_tasks.php">Tasks</a></li>
	<li><a href="#">Export/ Report</a></li>
	<li><a href="#">What&#39s New</a></li>
	<li><a href="#">Help</a></li>
	</ul><br><br>
EOD;
echo $x;

Open in new window

Avatar of Richard Korts

ASKER

Yeah, that works.

I was always led to believe that I could put pure html in a page & save it as xyz.php & it would still work.

I guess not so always.

Thanks
To Ray_Paseur

That makes it clearer.

Thanks