Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP code causing IE7 Problem

Status
Not open for further replies.

HMKS

MIS
Feb 25, 2008
6
US
Good morning all, I am not receiving an error but my drop down menus won't work only in IE7 when I use the following php code

<?
session_start();
if ($_SESSION[valid] != "yes") {
session_register('valid'); }
$db_name = "database"; $table_name = "Articles";
$connection = @mysql_connect("localhost", "database", "password") or die (mysql_error());
$db = @mysql_select_db($db_name,$connection) or die(mysql_error());

$sql ="SELECT article_name, image, text, bigimage, alttext FROM $table_name WHERE a_id = \"12\" ";
$result = @mysql_query($sql,$connection) or die ("aint gonna be able to do it");
while ($row = mysql_fetch_array($result)) {
$article_name = $row[article_name];
$image = $row[image];
$text = $row[text];
$bigimage = $row[bigimage];
$alttext = $row[alttext];
}
?>

with the following xhtml

here is the css

#multi-level {height:30px; position:relative; z-index:100;}
#multi-level .pad {float:left;}
.menu, .menu ul {list-style-type:none; padding:0; margin:0; font-family:arial, sans-serif;}
.menu li.top {display:block; float:left; position:relative;}
.menu table {border-collapse:collapse; width:0; height:0; position:absolute; top:0; left:0;}
.menu li.top a.top_link {display:block; float:left; height:35px;}
.menu li.top a span {position:absolute; left:-9999px; top:0; z-index:0; font-size:10px;}
.menu li.p1 {width:90px; background:url( no-repeat;;}
.menu li.p2 {width:90px; background:url( no-repeat;; }
.menu li.p3 {width:118px; background:url( no-repeat;;}
.menu li.p4 {width:105px; background:url( no-repeat;; }
.menu li.p5 {width:120px; background:url( no-repeat;; }
.menu li.p6 {width:120px; background:url( no-repeat;; }
.menu li a#home {width:90px; background:url( no-repeat;}
.menu li a#shop {width:90px; background:url( no-repeat;}
.menu li a#entertainment {width:118px; background:url( no-repeat;}
.menu li a#contacts {width:105px; background:url( no-repeat;}
.menu li a#aboutus {width:120px; background:url( no-repeat;}
.menu li a#community {width:120px; background:url( no-repeat;}
.menu a:hover {visibility:visible;}
.menu li:hover {position:relative; z-index:200;}
.menu li a#home:hover, .menu li:hover a#home,
.menu li a#shop:hover, .menu li:hover a#shop,
.menu li a#entertainment:hover, .menu li:hover a#entertainment,
.menu li a#contacts:hover, .menu li:hover a#contacts,
.menu li a#aboutus:hover, .menu li:hover a#aboutus,
.menu li a#community:hover, .menu li:hover a#community {background:transparent;}
.menu ul,
.menu :hover ul ul,
.menu :hover ul :hover ul ul,
.menu :hover ul :hover ul :hover ul ul,
.menu :hover ul :hover ul :hover ul :hover ul ul {position:absolute; left:-9999px; top:-9999px; width:0; height:0;}
.menu :hover ul.sub {left:0; top:35px; background: #fff; padding:3px 0; border:1px solid #888; white-space:nowrap; width:93px; height:auto;}
.menu :hover ul.sub li {display:block; height:20px; position:relative; float:left; width:90px;}
.menu :hover ul.sub li a {display:block; font-size:11px; height:20px; width:87px; line-height:20px; text-indent:5px; color:#000; text-decoration:none; border:3px solid #fff; border-width:0 0 0 3px;}
.menu :hover ul.sub li a.fly {background:#fff 80px 7px no-repeat;}
.menu :hover ul.sub li a:hover {background:#63C6DE; color:#fff;}
.menu :hover ul.sub li a.fly:hover {background:#63C6DE 80px 7px no-repeat; color:#fff;}
.menu :hover ul li:hover > a.fly {background:#63C6DE 80px 7px no-repeat; color:#fff;}
.menu :hover ul :hover ul,
.menu :hover ul :hover ul :hover ul,
.menu :hover ul :hover ul :hover ul :hover ul,
.menu :hover ul :hover ul :hover ul :hover ul :hover ul
{left:90px; top:-4px; background: #fff; padding:3px 0; border:1px solid #888; white-space:nowrap; width:93px; z-index:200; height:auto;}


then the xhtml

<div id="multi-level" class="links">

<ul class="menu">

<li class="top p1"><a href=" id="home" class="top_link"><span>Home</span></a></li>

<li class="top p2"><a href=" id="shop" class="top_link"><span>Products</span><!--[if IE 7]><!--></a><!--<![endif]-->

<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub">

<li><a href=" class="fly" ONMOUSEOVER="window.status='Check out our latest styles of clothing';return true" title="Browse our selections">Stee-Lo Clothing<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><!--[if lte IE 6]></td></tr></table></a><![endif]--></li>
</ul>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>

<li class="top p3"><a href=" id="entertainment" class="top_link"><span>Services</span><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub">

<li><a href=" title="Video Clips, Sound Clips and Jokes" ONMOUSEOVER="window.status='Submit your best joke or read ours, watch video clips and listen to sound clips, great for a good laugh';return true">Jokes</a></li>

<li><a href=" ONMOUSEOVER="window.status='Hating with an attitude, check out this column for advice from Haters Inc.';return true" title="Need advice! Haters Inc. can help!">Advice Column</a></li>

</ul>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

<li class="top p4"><a href=" id="contacts" class="top_link"><span>Contacts</span><!--[if IE 7]><!--></a><!--<![endif]-->

<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub">

<li><a href=" ONMOUSEOVER="window.status='Contact the staff at KMA';return true" title="Questions, comments and suggestions are welcome. Click here for our feedback form">Contact KMA</a></li>
</ul>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

<li class="top p5"><a href=" id="aboutus" class="top_link"><span>Shop</span><!--[if IE 7]><!--></a><!--<![endif]-->

<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub">

<li><a href=" ONMOUSEOVER="window.status='Just some detailed info from the creator of cayema.com';return true" title="Ideas from the ceo of Cayema">Webmaster Note</a></li>
<li><a href=" Policy</a></li>

</ul>

<!--[if lte IE 6]></td></tr></table></a><![endif]-->

</li>

<li class="top p6"><a href=" id="community" class="top_link"><span>Shop</span><!--[if IE 7]><!--></a><!--<![endif]-->

<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul class="sub">

<li><a href=" Boards</a></li>
<li><a href=" ONMOUSEOVER="window.status='Send in your pic to win a cash prize in the cayema picture contest';return true" title="Enter the picture contest winner gets a cash prize">Picture Contest</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
</div>

This code works fine in IE6 and Firefox but the drop downs won't work in IE7. Anybody know a fix for this?
 
it has nothing to do with php, therefore this is the wrong forum.

as i cannot see any <select> controls in this clip i can only assume that you are using some javascript mock-up. you might therefore (i) post the javascript and (ii) ask your question; in the javascript forum.
 
Jpadie thanks for the help but there is no JavaScript for this code everything you see above is what makes the links dropdown. When I remove the PHP code the dropdowns work which is why I thought it was something with the PHP. What would be the correct forum?
 
well...

you are not enclosing your style declarations in <style> tags. so given that your php is almost certainly spitting out warnings and notices that might disrupt your styles.

your php is badly formed. you have not enquoted your array keys, you are using deprecated functionality (session_register). Whether or not this impacts your code is dependent on what error settings you have.

i suggest that you examine the output html and validate them with a service like w3cvalidator. with that output I am sure that the members of the html, xhtml and css forum will be able to assist.
 
I agree, your PHP code should be spitting out a slew of warnings, that dependent on your server settings may be disrupting your page rendering.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top