解析错误:语法错误,意外T_CONSTANT_ENCAPSED_STRING,期待','或';'

时间:2014-11-19 05:21:39

标签: php html css web

因为我编辑了图片的来源,我收到了这个错误。

但是,它在编辑之前工作正常。

这是我的整个代码:

<?php
session_start();
require_once("/home/a9440778/public_html/registration/connect.php");
function escape_data($data)
{
global $dbc;
if(ini_get('magic_qoutes_gpc'))
{
$data=striplashes($data);
}
return mysql_real_escape_string($data,$dbc);
}
error_reporting(E_ALL & ~E_NOTICE);
echo"
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Natuna Scean Manpower Corporation</title>
<body>
<center>
<table>
<tr>
<td colspan='2' align='center'><img src="/home/a9440778/public_html/registration/head.png" alt="Header Image Here"></center></td>
</tr>
<tr>
<td align='center' colspan='2'>
<img src="/home/a9440778/public_html/registration/jobs.png" alt="Secondary Header Image Here">
</td>
</tr>
<tr><td colspan='2' align='right'>Log in as Staff? <a href='../adminindex.php'> LOG IN</a></td></tr>
<tr><td colspan='2' align='left'>&nbsp;&nbsp;&nbsp;&nbsp;Click on the Job Titles to see more information. </td></tr>
<tr>
<td valign='top' align='left'><font color='#3365f5' size='3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Deck Officers and Ratings</b></font><br><br>";
$query=mysql_query("select job_id,job_title from jobs where job_category='Deck';")
or die("jbsoftwares 1".mysql_error());
while($myrow=mysql_fetch_array($query))
{
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='jobview.php?job_id=$myrow[0]'>$myrow[1]</a><br/>";
}
echo"</td>
<td valign='top' align='left'><font color='#3365f5' size='3'><b>Engine Officers and Ratings</b></font><br><br>";
$query=mysql_query("select job_id,job_title from jobs where job_category='Engine';")
or die("jbsoftwares 1".mysql_error());
while($myrow=mysql_fetch_array($query))
{
echo"<a href='jobview.php?job_id=$myrow[0]'>$myrow[1]</a><br/>";
}
echo"</td>
</tr>
<tr>
<td valign='top' align='left'><font color='#3365f5' size='3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Construction</b></font><br><br>";
$query=mysql_query("select job_id,job_title from jobs where job_category='Construction';")
or die("jbsoftwares 1".mysql_error());
while($myrow=mysql_fetch_array($query))
{
echo"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='jobview.php?job_id=$myrow[0]'>$myrow[1]</a><br/>";
}
echo"</td>
<td valign='top' align='left'><font color='#3365f5' size='3'><b>Catering and Galley</b></font><br><br>";
$query=mysql_query("select job_id,job_title from jobs where job_category='Catering and Galley';")
or die("jbsoftwares 1".mysql_error());
while($myrow=mysql_fetch_array($query))
{
echo"<a href='jobview.php?job_id=$myrow[0]'>$myrow[1]</a><br/>";
}
echo"</td>
</tr>
<tr>
<td align='center' colspan='2'>
<img src='/home/a9440778/public_html/footer.png'>
</td>
</tr>
</table>
</center>
</body>
</html>
";
?>

系统指出了这一行的错误:

<td colspan='2' align='center'><img src="/home/a9440778/public_html/registration/head.png" alt="Header Image Here"></center></td>

我在这里做错了什么? 非常感谢您的回答。

1 个答案:

答案 0 :(得分:2)

您使用双引号启动了回显字符串,并且src=".."alt=".."有双引号,因此您需要使用单'或使用\" <转义它/ p>