我有语法错误,我下面的代码语法错误,在PHP代码
<?php
If (!empty($_SESSION['LogedinStudentId'])) {
echo '<h3>Your Scholarship Applications:</h3>
<table width="100%" class="table table-bordered">
<tr>
<th scope="col">Sr.No.</th>
<th scope="col">Date of Application</th>
<th scope="col">Course Type</th>
<th scope="col">Course Description</th>
<th scope="col">Subject</th>
<th scope="col">Applied for Semester No.</th>
<th scope="col">Scholarship Status</th>
<th scope="col">View/Print</th>
</tr>
<tr>
<td>' . ++$serialno . '</td>
<td>' . if(empty($row_studentdashboard['DateofApplication'])) {
echo ' ';
} else {
echo date("d-m-Y", strtotime($row_studentdashboard['DateofApplication']));
};
. '</td>
<td>' . $row_studentdashboard['CourseType'] .'</td>
<td>' . $row_studentdashboard['CourseDescriptionLong'] .'</td>
<td>' . $row_studentdashboard['Subject'] .'</td>
<td>' . $row_studentdashboard['ApplyForSemYear'] .'</td>
<td>' . $row_studentdashboard['ScholarshipStatus'] .'</td>
<td><a href="#">View</a>/<a href="#">Print</a></td>
</tr>
</table>';
} else {
echo '<h3>You do not have any application pending</h4>';
}
?>
我收到语法错误就行无法逃避的HTML。 17和22.第二个(嵌套的)if语句抛出语法错误。我无法判断出了什么问题。如果我运行这第二个if语句之外的HTML它工作正常。 任何人都可以指出什么是错的?
什么语法错误? – peter
'if(condition){echo and concatenate properly}' –
@激光*“什么语法错误?” - 可能是“意想不到的T_IF - T_ECHO”或沿着那条线;-) –