我有一个文件 /admin/php.php ,其中包含以下内容:
<?php
$ID=$_GET['ID'];
require("../admin/config.php");
$sql = "SELECT * FROM contacts WHERE contacttype IN ('New','Buyer','Seller','Buyer / Seller','Investor') AND leadstatus = 'New' ORDER BY date DESC";
$space = (!empty($row['firstname']) && !empty($row['lastname'])) ? ' ' : '';
$name = $row['firstname'].$space.$row['lastname'];
$partner = $row['spousefirst'];
$cell = (!empty($row['phonecell'])) ? " {$row['phonecell']} (cell)" : '';
$email = (!empty($row['email'])) ? " {$row['email']} (email)" : '';
mysql_query($sql) or die ("Error: ".mysql_error());
?>
在另一个页面 /admin/index.php 我有:
<?php require("php.php"); ?>
<tbody>
<tr>
<td><input type="checkbox" name="" id="" value="<?php echo $row['ID']; ?>"></td>
<td><a href="/admin/leads/view/?ID=<?php echo $row['ID']; ?> "><strong><?php echo $name; ?></strong></a></td>
<td><a href="/admin/leads/view/?ID=<?php echo $row['ID']; ?> "><?php echo $partner; ?></a></td>
<td><?php echo $row['phonecell']; ?></td>
<td><a href="mailto:<?php echo $row['email']; ?>"><?php echo $row['email']; ?></a></td>
<td><?php echo date("M jS, g:i A", strtotime($row['date'])); ?></td>
<td><?php echo $row['contacttype']; ?></td>
<td><?php echo $row['agentassigned']; ?></td>
<td><?php echo $row['leadstatus']; ?></td>
<td><a href="/admin/contacts/notes.php?ID=<?php echo $row['ID']; ?>">View </a>+ </td>
<td><a href="/admin/contacts/todo.php?ID=<?php echo $row['ID']; ?>">View </a>+ </td>
<td><a href="/admin/contacts/deletesuccess.php?ID=<?php echo $row['ID']; ?>">D</a></td>
</tr>
</tbody>
<?php
}
mysql_close();
?>
</table>
当我运行它时,我得到一个 Parse 错误:语法错误,/admin/index.php 中的意外'}'。我尝试<?php
在 /admin/index.php 中删除“}”,但在 /admin/php.php 中出现意外 $end 错误。真的很困惑为什么这不起作用。谢谢你的帮助!