mwmobley Posted October 2, 2006 Share Posted October 2, 2006 I have a simple 2 col 5 row table that i'm using to display a description in the first row and a thumbnail link in the second.I originally created the HTML for the table in DreamWeaver, then used the HTML to create my echos in php since I need to retrieve the descriptions from mysql. It works perfectly in Firefox and Netscape but, Internet explorer draws a border around it (with border=0) and only displays 1 of the five thumbnails.Also, the HTML works just fine in Internet Explorer. Why would IE treat the php code differently?Any help would REALLY be appreciated. I don't understand why it works perfectly in one place and is so screwed up in the other.... Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/ Share on other sites More sharing options...
Hi I Am Timbo Posted October 2, 2006 Share Posted October 2, 2006 IE Doesn't treate php code at all. It only interprets the HTML that it sees. There is likely an error in the HTML that is being output. Can you supply some code? Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102619 Share on other sites More sharing options...
printf Posted October 2, 2006 Share Posted October 2, 2006 Can you please give a code example.me! Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102621 Share on other sites More sharing options...
mwmobley Posted October 2, 2006 Author Share Posted October 2, 2006 Heres the php code that starts the table and the first row. // Create table to display teasers and link on mag home page echo '<table width=\"347\" height=\"464\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">'; // Camping Row echo '<tr>'; echo '<td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />'; echo "$CampingTeaser</p></td>"; echo '<td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td>'; echo '</tr>';Here is a link to where I have been working on it http://www.testeclifestyle.com/guest/country_recreation/The top part is straight HTML, the bottom is this first line in PHP. In Firefox, you will see it centered in the table..in IE it comes up w/borders an no thumbnail....thanks for looking! Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102629 Share on other sites More sharing options...
mwmobley Posted October 2, 2006 Author Share Posted October 2, 2006 Or take a look at the difference between Firefox and IE at http://www.testeclifestyle.com/guest/country_kitchen/I don't understand whats causing this in IE.....thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102635 Share on other sites More sharing options...
michaellunsford Posted October 2, 2006 Share Posted October 2, 2006 well, the first thing that jumps out at me is you're escaping double quotes inside the single quotes -- this is not necessary. I checked your link source in my browser and see that they remain escaped (which could throw IE for a loop). Fix that and see what happens. Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102637 Share on other sites More sharing options...
Hi I Am Timbo Posted October 2, 2006 Share Posted October 2, 2006 [quote author=mwmobley link=topic=110282.msg445546#msg445546 date=1159818051] // Create table to display teasers and link on mag home page echo '<table width=\"347\" height=\"464\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">'; // Camping Row echo '<tr>'; echo '<td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />'; echo "$CampingTeaser</p></td>"; echo '<td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td>'; echo '</tr>';[/quote]You can't escape things inside of single quotes in PHP. That is another of the main differences between single and double quotes. Looks like you have the variable parsing down. I would recommend just changing the first and last quotes to double quotes:[code]<?php // Create table to display teasers and link on mag home page echo "<table width=\"347\" height=\"464\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; // Camping Row echo '<tr>'; echo "<td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />"; echo "$CampingTeaser</p></td>"; echo "<td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td>"; echo '</tr>';?>[/code]The output HTML before the change looks like this:[code] <table width=\"347\" height=\"464\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"295\" height=\"60\" border =\"0\"><p><a href="./camping.php"><strong>Camping:</strong></a><br />If you are crazy enough....</p></td><td width=\"58\"><a href="./camping.php"><img src="images/camping_thumb.jpg" width=\"55\" height=\"55\" /></a></td></tr></table> <!-- End mwm -->[/code]Another fix would be using single quotes and not escaping the double quotes. The only problem is then you can't insert newlines in your HTML, which you should. Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102638 Share on other sites More sharing options...
nickholt1972 Posted October 2, 2006 Share Posted October 2, 2006 I'm not really an 'advice-giving level' expert but I do a lot of things for ie and I don't think you need all those backslashes because if you're starting your echo string with a [b]' [/b]and ending it with a [b]'[/b], it won't mind if you have a load of [b]"[/b]s in the middle.nice looking site, by the way. Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102640 Share on other sites More sharing options...
mwmobley Posted October 2, 2006 Author Share Posted October 2, 2006 Thanks a Bunch Guys....It really threw me when it worked correctly in Fiefox and Netscape.....I REALLY appreciate all the extra eyes!!!mike Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102645 Share on other sites More sharing options...
Barand Posted October 2, 2006 Share Posted October 2, 2006 [quote author=Hi I Am Timbo link=topic=110282.msg445555#msg445555 date=1159818822]You can't escape things inside of single quotes in PHP. That is another of the main differences between single and double quotes. [/quote]@Hi I Am Timbo,[code]<?php$str = 'It\'s possible to escape single quotes at least';echo $str;?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/22788-table-works-in-firefox-but-not-in-internet-explorer/#findComment-102725 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.