Php 分析错误:语法错误,意外的T_打印

Php 分析错误:语法错误,意外的T_打印,php,syntax-error,Php,Syntax Error,我已经搜索过了,没有找到任何关于T_PRINT语法错误的信息。就这样,我不认为这是“意外的”。这是指打印“您的员工申请已发布”等行 <?php session_start(); include "globals.php"; if($_POST['app']) { $db->query("INSERT INTO staffapps VALUES('',$userid,'{$_POST['pos']}','{$_POST['app']}')", $c) or die ("Your s

我已经搜索过了,没有找到任何关于T_PRINT语法错误的信息。就这样,我不认为这是“意外的”。这是指打印“您的员工申请已发布”等行

<?php
session_start();
include "globals.php";
if($_POST['app']) 
{ 
$db->query("INSERT INTO staffapps VALUES('',$userid,'{$_POST['pos']}','{$_POST['app']}')", $c)
or die
("Your staff application could not be processed. Make sure you have filled out the form completely!"); 
 
print "Your Staff Application has been posted for our staff to review, your results will be decided within 14 days! Good Luck!"; 
 
} 
else
 
print "<h3>Staff Application</h3>
 
 
<center><h8><b>Please read the <a href='stafftoc.php'><font color='yellow'>Terms & Conditions</font></a>before sending an application!</b>
 
<form action='staffapps.php' method='post'>
Position <select name='pos'><option value='3'>Admin</option><option value='5'>Secretary</option><option value='6'>Assistant</option></select>
 
Why do you deserve the position?
 
Please bare in mind that staff look for professional members so be sure to spell correctly with the right grammar and punctuation!
 
If your staff application appears un-professional, it will be dismissed! 
 
<textarea rows='7' cols='40' name='app'>{$_GET['app']}</textarea>
 
<input type='submit' value='Submit Application' /></form>";
 
$h->endpage;
?>

有些代码行似乎有一些不应该出现的有趣的尾随字符;以下是它们的十六进制表示:

0xc2 0xa0

有人告诉我,这是一场灾难。从代码中清除这些字符应该可以解决问题。

而且我正在下载netbeans,所以不需要告诉我使用IDE(我读过):D在其他地方是“终止(;)”?在将其传递到数据库之前,您应该真正检查
$\u POST
值。或者使用事先准备好的声明
PDO
是一个很好的数据库包装器。:)@Mahesh.D如果你说的是
";
用于
print
语句,然后它位于
$h->endpage正上方的底部。对我来说,此代码不包含任何语法错误。我可以在没有任何解析错误的情况下运行它。问题一定在别的地方。我看不出有这样的事。你是如何检查的?@Cthulhu使用
php-r“打印”(explode('0a',bin2hex(file_get_contents('myscript.php')));
0xc2 0xa0是一个不间断的空格,没有任何有趣的东西我复制了OP发布的代码,无法复制它。:@Cthulhu我从编辑框中复制了它,而不是从标记渲染中复制的。