The person used TABs instead of 4 spaces for the PHP portion of the code. The tabs look fine in the editor, but become full-width tabs. I went ahead and replaced all the tabs with 4 spaces and removed the code snippet out.
Edit: The person used a mix of TABs and spaces. I assume the snippet thing didn't like this.
Edit 2: And THEN THE POST IMPLODED so now none of us can see the differences.
Original, in snippets.
<head>
<title>Desktop</title>
</head>
<body style="font-family:Arial;">
<table border="1">
<thead>
<tr>
<td><strong>REG</strong></td>
<td><strong>VAS</strong></td>
<td><strong>SRS</strong></td>
<td><strong>ETA</strong></td>
<td><strong>CS</strong></td>
</tr>
</thead>
<tbody>
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$serverName = “1.2.3.4”; //serverName\instanceName
$connectionInfo = array( "Database"=>”database”, "UID"=>”user”, "PWD"=>”password”);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
$sql = ("SELECT * FROM table WHERE AccountID = ‘12345’”);
$stmt = sqlsrv_query($conn, $sql);
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
};
if($row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) {
?>
<tr>
<td style="text-transform:Uppercase"><?php echo $row[‘REG’]?></td>
<?php
IF ($row[“VAS”]=="Tick") {
echo "<td bgcolor=green; style=color:white;>";
echo "VAS “Complete;
echo "</td>";
} ELSE {
echo "<td bgcolor=red>";
echo "VAS Incomplete”;
echo "</td>";
}
?>
<?php
IF ($row["Being_Serviced"]=="Tick") {
echo "<td bgcolor=green; style=color:white;>";
echo “SRS Complete”;
echo "</td>";
} ELSE {
echo "<td bgcolor=red>";
echo “SRS Incomplete”;
echo "</td>";
}
?>
<td>
<?php
IF ($row["ETA"]=="") {
echo "No ETA available";
} ELSE {
echo $row["ETA"];
}
?>
</td>
<?php
IF ($row["Service_Complete"]=="Tick") {
echo "<td bgcolor=green; style=color:white;>";
echo “CS Complete”;
echo "</td>";
} ELSE {
echo "<td bgcolor=red>";
echo “CS Incomplete”;
echo "</td>";
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</html>
Outside of snippet box:
<head>
<title>Desktop</title>
</head>
<body style="font-family:Arial;">
<table border="1">
<thead>
<tr>
<td><strong>REG</strong></td>
<td><strong>VAS</strong></td>
<td><strong>SRS</strong></td>
<td><strong>ETA</strong></td>
<td><strong>CS</strong></td>
</tr>
</thead>
<tbody>
<?php
ini_set('display_errors', 1);
error_reporting(~0);
$serverName = “1.2.3.4”; //serverName\instanceName
$connectionInfo = array( "Database"=>”database”, "UID"=>”user”, "PWD"=>”password”);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
$sql = ("SELECT * FROM table WHERE AccountID = ‘12345’”);
$stmt = sqlsrv_query($conn, $sql);
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
};
if($row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) {
?>
<tr>
<td style="text-transform:Uppercase"><?php echo $row[‘REG’]?></td>
<?php
IF ($row[“VAS”]=="Tick") {
echo "<td bgcolor=green; style=color:white;>";
echo "VAS “Complete;
echo "</td>";
} ELSE {
echo "<td bgcolor=red>";
echo "VAS Incomplete”;
echo "</td>";
}
?>
<?php
IF ($row["Being_Serviced"]=="Tick") {
echo "<td bgcolor=green; style=color:white;>";
echo “SRS Complete”;
echo "</td>";
} ELSE {
echo "<td bgcolor=red>";
echo “SRS Incomplete”;
echo "</td>";
}
?>
<td>
<?php
IF ($row["ETA"]=="") {
echo "No ETA available";
} ELSE {
echo $row["ETA"];
}
?>
</td>
<?php
IF ($row["Service_Complete"]=="Tick") {
echo "<td bgcolor=green; style=color:white;>";
echo “CS Complete”;
echo "</td>";
} ELSE {
echo "<td bgcolor=red>";
echo “CS Incomplete”;
echo "</td>";
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</html>