anthonydamasco Posted April 11, 2007 Share Posted April 11, 2007 Hey everyone. I have a simple php script that was working fine until my company upgraded to IE7. IE7 just shows the background and nothing else. It works on EI6, and firefox <?php $conn = mysql_connect("localhost","user","user") or die ( mysql_error() ); $db = mysql_select_db("ACCU") or die ( mysql_error() ); $search=$_POST["search"]; $result = mysql_query("SELECT * FROM phonelist"); $num = mysql_num_rows($result); if ($num == "0"){ echo "Please revise your search."; }else{ while($r=mysql_fetch_array($result)) { $phoneid=$r["idphonelist"]; $name=$r["name"]; $ext=$r["ext"]; $dept=$r["department"]; $cell=$r["cellphone"]; echo " <table width=\"515\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#FFFFFF\"> <tr> <td><table width=\"515\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"> <tr> <td width=\"178\">$name</td> <td width=\"40\">$ext</td> <td width=\"212\">$dept </td> <td width=\"85\">$cell</td> </tr> </table></td> </tr> </table> "; } } ?> any ideas. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/ Share on other sites More sharing options...
wildteen88 Posted April 11, 2007 Share Posted April 11, 2007 PHP shouldn't have any effect on how browsers render a website. It runs on the server and not the client. It most probably an HTML issue and not a PHP issue. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227198 Share on other sites More sharing options...
Hughesy1986 Posted April 11, 2007 Share Posted April 11, 2007 Try this, I always escape from php when im ouputting alot of information. and then just echo the values. <?php $conn = mysql_connect("localhost","user","user") or die ( mysql_error() ); $db = mysql_select_db("ACCU") or die ( mysql_error() ); $search=$_POST["search"]; $result = mysql_query("SELECT * FROM phonelist"); $num = mysql_num_rows($result); if ($num == "0"){ echo "Please revise your search."; }else{ while($r=mysql_fetch_array($result)) { $phoneid=$r["idphonelist"]; $name=$r["name"]; $ext=$r["ext"]; $dept=$r["department"]; $cell=$r["cellphone"]; ?> <table width="515" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td><table width="515" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178"><?php echo $name; ?></td> <td width="40"><?php echo $ext; ?></td> <td width="212"><?php echo $dept; ?> </td> <td width="85"><?php echo $cell; ?></td> </tr> </table></td> </tr> </table> <?php } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227200 Share on other sites More sharing options...
HappyPandaFace Posted April 11, 2007 Share Posted April 11, 2007 Try this, I always escape from php when im ouputting alot of information. and then just echo the values. <?php $conn = mysql_connect("localhost","user","user") or die ( mysql_error() ); $db = mysql_select_db("ACCU") or die ( mysql_error() ); $search=$_POST["search"]; $result = mysql_query("SELECT * FROM phonelist"); $num = mysql_num_rows($result); if ($num == "0"){ echo "Please revise your search."; }else{ while($r=mysql_fetch_array($result)) { $phoneid=$r["idphonelist"]; $name=$r["name"]; $ext=$r["ext"]; $dept=$r["department"]; $cell=$r["cellphone"]; ?> <table width="515" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td><table width="515" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178"><?php echo $name; ?></td> <td width="40"><?php echo $ext; ?></td> <td width="212"><?php echo $dept; ?> </td> <td width="85"><?php echo $cell; ?></td> </tr> </table></td> </tr> </table> <?php } } ?> You wouldn't actually have to echo them, you could use <?= $cell; ?> instead of <?php echo $cell; ?> Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227243 Share on other sites More sharing options...
per1os Posted April 11, 2007 Share Posted April 11, 2007 A note to what panda face said, the <?= is being depreciated, it is safer to use the <?php echo $cell; ?> OR <?php print $cell; ?> due to that. Just an fyi =) Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227247 Share on other sites More sharing options...
anthonydamasco Posted April 12, 2007 Author Share Posted April 12, 2007 It's still doing the same thing to me after I tried escaping from php <?php $conn = mysql_connect("localhost","www2","accuoffice") or die ( mysql_error() ); $db = mysql_select_db("ACCU") or die ( mysql_error() ); $search=$_POST["search"]; $result = mysql_query("SELECT * FROM phonelist"); $num = mysql_num_rows($result); if ($num == "0"){ echo "Please revise your search."; }else{ while($r=mysql_fetch_array($result)) { $phoneid=$r["idphonelist"]; $name=$r["name"]; $ext=$r["ext"]; $dept=$r["department"]; $cell=$r["cellphone"]; ?> <table width="515" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td><table width="515" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178"><?php print $name; ?></td> <td width="40"><?php print $ext; ?></td> <td width="212"><?php print $dept; ?></td> <td width="85"><?php print $cell; ?></td> </tr> </table></td> </tr> </table> <?php } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227526 Share on other sites More sharing options...
HappyPandaFace Posted April 12, 2007 Share Posted April 12, 2007 Check your preferences in IE 7. Maybe it disallows side-scripts or something like that. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227803 Share on other sites More sharing options...
kenrbnsn Posted April 12, 2007 Share Posted April 12, 2007 You're code works fine for me in IE7, so there may be something else in other parts of you script that is causing the problems. Here's some code that does what you're nested tables do, without the tables: <div style="width:526px;border:1px solid black;display:block;clear:both;"> <span style="width:178px;float:left;border:1px solid red"><?php echo $name; ?></span> <span style="width:40px;float:left"><?php echo $ext; ?></span> <span style="width:212px;float:left"><?php echo $dept; ?> </span> <span style="float:left"><?php echo $cell; ?></span> <div style="clear:both;line-height:0.01"> </div> </div> Try it and see if the problem still occurs. Ken Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227829 Share on other sites More sharing options...
anthonydamasco Posted April 12, 2007 Author Share Posted April 12, 2007 no its still doing it. All I get is the background. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-227872 Share on other sites More sharing options...
winder Posted July 23, 2007 Share Posted July 23, 2007 hello my first post here i think i have the exact same problem. No matter what script i'm puting into a page...it simply doesn't work in ie7. But it works like a charm in firefox. And i'm just wondering what's going on? i use wamp. any help? Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-305056 Share on other sites More sharing options...
teng84 Posted July 23, 2007 Share Posted July 23, 2007 i haven't experience that but can you tell me the error your getting Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-305057 Share on other sites More sharing options...
dbo Posted July 23, 2007 Share Posted July 23, 2007 View source and paste in the HTML that is getting rendered. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-305101 Share on other sites More sharing options...
winder Posted July 23, 2007 Share Posted July 23, 2007 OMG! I just solved my problem... I feel so stupid i was doing this... in firefox i have a link button in favorities that loads the site with the correct test server url http://localhost/... etc. BUT when i was trying to view the same site with ie7 i was just doing a right click in index.php of my site and then open with -> internet explorer. That makes the url being sth like C:\wamp\www\... so test server wasn't working. All fine now... Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-305314 Share on other sites More sharing options...
ViN86 Posted July 23, 2007 Share Posted July 23, 2007 please mark problem as solved. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-305365 Share on other sites More sharing options...
winder Posted July 23, 2007 Share Posted July 23, 2007 i didn't start this thread. I don't know if this solves the problem mentioned at the beginning. Quote Link to comment https://forums.phpfreaks.com/topic/46647-internet-explorer-7-hates-my-simple-php-code/#findComment-305592 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.