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
Richard KortsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WebDevEMCommented:
Hi,

You're wrapping the HTML content in php tags... The server is trying to interpret your HTML as php now.  Move the <?php and ?> tags around only what's truly php, like below:

WebDevEM
<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) { ?>
		<li><a href="manage_clients">Manage Clients</li>
	<?php } ?>	
		<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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WebDevEMCommented:
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

0
Ray PaseurCommented:
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

0
Richard KortsAuthor Commented:
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
0
Richard KortsAuthor Commented:
To Ray_Paseur

That makes it clearer.

Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.