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
PHP

Avatar of undefined
Last Comment
Richard Korts

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
WebDevEM

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
WebDevEM

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

Ray Paseur

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

ASKER
Richard Korts

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
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER
Richard Korts

To Ray_Paseur

That makes it clearer.

Thanks