The following code works just fine on my
page, but won't work on my
page. Plus, it delivers 9 validation errors that I don't know how to handle, and one caution.[code=php]<div class="colmask fullpage">
<div class="col1">
<!-- Start Content -->
<?php
include("dbinfo .inc.php");
$query="SELECT * FROM webhosts ORDER BY progname ASC";
$result=mysql_q uery($query)or die(mysql_error ());
$num=mysql_numr ows($result);
$i=0;
mysql_close();
?>
<table>
<tr>
<th>Host Name</th>
<th>Established </th>
<th>Price</th>
<th>Disk Space</th>
<th>Bandwidth </th>
<th>Economy Plan Available</th>
<th>Allows Mailing Lists</th>
<th>Server Platform</th>
<th>SSL Included</th>
<th>eCommerce Ready</th>
<th>Affiliate Program</th>
</tr>
<?php
while ($i < $num) {
$hostname=mysql _result($result ,$i,"hostname") ;
$url=mysql_resu lt($result,$i," url");
$established=my sql_result($res ult,$i,"establi shed");
$price=mysql_re sult($result,$i ,"price");
$diskspace=mysq l_result($resul t,$i,"diskspace ");
$bandwidth=mysq l_result($resul t,$i,"bandwidth ");
$econplan=mysql _result($result ,$i,"econplan") ;
$maillists=mysq l_result($resul t,$i,"maillists ");
$platform=mysql _result($result ,$i,"platform") ;
$ssl=mysql_resu lt($result,$i," ssl");
$ecommerce=mysq l_result($resul t,$i,"ecommerce ");
$affiliate=mysq l_result($resul t,$i,"affiliate ");
?>
<tr>
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>
<td><?php echo $established; ?></td>
<td><?php echo $diskspace; ?></td>
<td><?php echo $bandwidth; ?></td>
<td><?php echo $econplan; ?></td>
<td><?php echo $maillists; ?></td>
<td><?php echo $platform; ?></td>
<td><?php echo $ssl; ?></td>
<td><?php echo $ecommerce; ?></td>
<td><?php echo $affiliate; ?></td>
</tr>
<?php
++$i;
}
?>
</table>
<!-- End Content -->
</div>
</div>[/code]
The errors delivered are as follows:
Line 86, Column 20: character "<" is the first character of a delimiter but occurred as data.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
Line 86, Column 20: XML Parsing Error: Unescaped '<' not allowed in attributes values.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 20: XML Parsing Error: attributes construct error.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 20: XML Parsing Error: Couldn't find end of Start Tag a line 86.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 69: XML Parsing Error: Opening and ending tag mismatch: td line 86 and a.
…?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 74: XML Parsing Error: Opening and ending tag mismatch: tr line 85 and td.
…$url; ?>"><?php echo $hostname; ?></a></td>✉
Line 96, Column 11: XML Parsing Error: Opening and ending tag mismatch: table line 55 and tr.
</tr>✉
Line 101, Column 10: XML Parsing Error: Opening and ending tag mismatch: div line 42 and table.
</table>✉
Line 106, Column 6: XML Parsing Error: Opening and ending tag mismatch: body line 27 and div.
</div>✉
Line 168, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 3 and body.
</body>
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Code:
?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" >
<div class="col1">
<!-- Start Content -->
<?php
include("dbinfo .inc.php");
$query="SELECT * FROM webhosts ORDER BY progname ASC";
$result=mysql_q uery($query)or die(mysql_error ());
$num=mysql_numr ows($result);
$i=0;
mysql_close();
?>
<table>
<tr>
<th>Host Name</th>
<th>Established </th>
<th>Price</th>
<th>Disk Space</th>
<th>Bandwidth </th>
<th>Economy Plan Available</th>
<th>Allows Mailing Lists</th>
<th>Server Platform</th>
<th>SSL Included</th>
<th>eCommerce Ready</th>
<th>Affiliate Program</th>
</tr>
<?php
while ($i < $num) {
$hostname=mysql _result($result ,$i,"hostname") ;
$url=mysql_resu lt($result,$i," url");
$established=my sql_result($res ult,$i,"establi shed");
$price=mysql_re sult($result,$i ,"price");
$diskspace=mysq l_result($resul t,$i,"diskspace ");
$bandwidth=mysq l_result($resul t,$i,"bandwidth ");
$econplan=mysql _result($result ,$i,"econplan") ;
$maillists=mysq l_result($resul t,$i,"maillists ");
$platform=mysql _result($result ,$i,"platform") ;
$ssl=mysql_resu lt($result,$i," ssl");
$ecommerce=mysq l_result($resul t,$i,"ecommerce ");
$affiliate=mysq l_result($resul t,$i,"affiliate ");
?>
<tr>
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>
<td><?php echo $established; ?></td>
<td><?php echo $diskspace; ?></td>
<td><?php echo $bandwidth; ?></td>
<td><?php echo $econplan; ?></td>
<td><?php echo $maillists; ?></td>
<td><?php echo $platform; ?></td>
<td><?php echo $ssl; ?></td>
<td><?php echo $ecommerce; ?></td>
<td><?php echo $affiliate; ?></td>
</tr>
<?php
++$i;
}
?>
</table>
<!-- End Content -->
</div>
</div>[/code]
The errors delivered are as follows:
Line 86, Column 20: character "<" is the first character of a delimiter but occurred as data.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
This message may appear in several cases:
You tried to include the "<" character in your page: you should escape it as "<"
You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe.
Another possibility is that you forgot to close quotes in a previous tag.
Line 86, Column 20: XML Parsing Error: Unescaped '<' not allowed in attributes values.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 20: XML Parsing Error: attributes construct error.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 20: XML Parsing Error: Couldn't find end of Start Tag a line 86.
<td><a href="<?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 69: XML Parsing Error: Opening and ending tag mismatch: td line 86 and a.
…?php echo $url; ?>"><?php echo $hostname; ?></a></td>✉
Line 86, Column 74: XML Parsing Error: Opening and ending tag mismatch: tr line 85 and td.
…$url; ?>"><?php echo $hostname; ?></a></td>✉
Line 96, Column 11: XML Parsing Error: Opening and ending tag mismatch: table line 55 and tr.
</tr>✉
Line 101, Column 10: XML Parsing Error: Opening and ending tag mismatch: div line 42 and table.
</table>✉
Line 106, Column 6: XML Parsing Error: Opening and ending tag mismatch: body line 27 and div.
</div>✉
Line 168, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 3 and body.
</body>
Comment