在注释上遇到语法错误?还是我错过了一些明显的东西


Getting a syntax error on a comment? Or am I missing something obvious?

我正在写一个报告表格,但我是一个非常奇怪的语法错误。

这是我的代码:

<h2>Report <u><?php echo $title; ?></u> Machine Program Error</h2>
<p><span class="error">* required field.</span></p>
<form action="send_form_email.php?email=yes"> 
   Job Number: <input type="text" name="jobid" value="<?php print ($jobid) ?>">
   <!--<span class="error">* <?phpecho $nameErr;?></span>-->
   <br><br>
   Part Number: <input type="text" name="partid" value="<?php print ($part_id) ?>">
   <!--<span class="error">* <?phpecho $emailErr;?></span>-->
   <br><br>
   Machine: <input type="text" name="mach" value="<?php print ($machCode) ?>">
   <!--<span class="error">* <?phpecho $machErr;?></span>-->
   <br><br>
   Note: <textarea name="comment" rows="5" cols="40" placeholder="More detail... (Is there a way to recreate the error?)"><?php echo $comment;?></textarea>
   <br><br>
   <input type="submit" name="submit" value="Submit"> 
</form>

带有注释的行; <!--<span class="error">* <?phpecho $nameErr;?></span>--><!--<span class="error">* <?phpecho $emailErr;?></span>--><!--<span class="error">* <?phpecho $machErr;?></span>-->都出现了语法错误。

我是否遗漏了一些明显的东西,或者我的 Dreamweaver CS5 有错误?如果两者之一为真,我该如何解决?

提前谢谢。

HTML注释对PHP没有影响。您还有一个语法错误

试试这个:

<h2>Report <u><?php echo $title; ?></u> Machine Program Error</h2>
<p><span class="error">* required field.</span></p>
<form action="send_form_email.php?email=yes"> 
   Job Number: <input type="text" name="jobid" value="<?php print ($jobid) ?>">
   <!--<span class="error">* <?php //echo $nameErr;?></span>-->
   <br><br>
   Part Number: <input type="text" name="partid" value="<?php print ($part_id) ?>">
   <!--<span class="error">* <?php //echo $emailErr;?></span>-->
   <br><br>
   Machine: <input type="text" name="mach" value="<?php print ($machCode) ?>">
   <!--<span class="error">* <?php //echo $machErr;?></span>-->
   <br><br>
   Note: <textarea name="comment" rows="5" cols="40" placeholder="More detail... (Is there a way to recreate the error?)"><?php echo $comment;?></textarea>
   <br><br>
   <input type="submit" name="submit" value="Submit"> 
</form>