Reputation:
The code below crashes IE6 for some reason. Much as IE is god-awful, i have never seen this before. Does anyone have any ideas?
<div id="edit">
<?php
$a = $_POST['category'];
if ($a == "")
{
$a = $_GET['category'];
}
$result = mysql_query("SELECT * FROM media WHERE related_page_id = $a && type= 'copy'");
?>
<table width="460px;">
<tr>
<td>Item</td>
<td> </td>
<td> </td>
<td> </td>
<td>Associated Images</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
echo "<tr style='vertical-align:top'><td>$row[title]</td>";
echo "<td><a href='addimage.php?id=$row[id]&&category=$a'>Add image/file</a>";
echo "<td><a href='change.php?id=$row[id]&&category=$a'>edit</a></td>";
echo "<td><a href='delete.php?id=$row[id]&&category=$a'>delete</a></td>";
echo "<td>";
$id = $row['id'];
$result1 = mysql_query("SELECT * FROM media WHERE assets = $id");
while($row1 = mysql_fetch_array($result1))
{
echo "<a href='$row1[path]'>$row1[title]</a> | <a href='delete.php?id=$row1[id]&&category=$a'>remove?</a><br />";
}
echo "</td></tr>";
}
if($a == 1 || $a == 3 || $a == 5){
}else{
echo "<tr><td colspan='5'> </td></tr>";
echo "<tr><td colspan='5'><a href='change.php?id=0&&category=$a'>New Item</a></td></tr>";
}
?>
</div>
</div>
</div>
</table>
</body>
</html>
Upvotes: 0
Views: 944
Reputation: 17426
I don't know if it's the reason for the crash, but the td
tag in the line
echo "<td><a href='addimage.php?id=$row[id]&&category=$a'>Add image/file</a>";
is not closed. Also:
</div>
</div>
</div>
</table>
should be:
</table>
</div>
</div>
</div>
Furthermore - for security reasons - check if $a
is numeric before using it in the query below.
$a = $_POST['category'];
if ($a == "")
{
$a = $_GET['category'];
}
$result = mysql_query("SELECT * FROM media WHERE related_page_id = $a && type= 'copy'");
Upvotes: 6
Reputation: 564
The generated code doesn't crash IE6 for me. It could probably be one of your stylesheets or javascript though, or maybe it's just my setup (IE6 is used as a standalone browser here).
Also, why do you have those double ampersands? Are you sure you don't want to use &
instead?
Upvotes: 0
Reputation:
here is the generated code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="../javascript/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced"
});
</script>
<title>Chapman Corp Site - CMS</title>
<link rel="stylesheet" href="../css/admin.css" type="text/css" media="screen" title="Chapman" charset="utf-8" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="../css/ie6.css" type="text/css" media="screen" />
<script type="text/javascript" src="../javascript/unitpngfix.js"></script>
<![endif]-->
</head>
<body>
<div id="page">
<div id ="content">
<p><a href="index.php">Home</a></p><div id="edit">
<table width="460px;">
<tr>
<td>Item</td>
<td> </td>
<td> </td>
<td> </td>
<td>Associated Images</td>
</tr>
<tr>
<td colspan="5"> </td>
</tr>
<tr style='vertical-align:top'><td>Home</td><td><a href='addimage.php?id=77&&category=1'>Add image/file</a><td><a href='change.php?id=77&&category=1'>edit</a></td><td><a href='delete.php?id=77&&category=1'>delete</a></td><td><a href='../uploads/footer.jpg'>footer.jpg</a> | <a href='delete.php?id=88&&category=1'>remove?</a><br /></td></tr></div>
</div>
</div>
</table>
</body>
</html>
Upvotes: 0