PadLock Posted June 11, 2012 Share Posted June 11, 2012 I'm working on a set of three pages for a client using a combination of PHP and JS to automatically check submitted information for errors and then email it if no error is found. That part is working smoothly but now that I have come to the "making it pretty" part I am having an odd issue. The page itself has 5 divs which are surrounded on all sides by divs containing drop shadows. The drop shadow at the bottom for whatever reason is refusing to be seen but the same div is being used on another page without issue. Here is the code for the page causing the trouble at the moment. <?php setcookie("fName", $_REQUEST["firstName"], time()+3600*24, '/', '.zest4life.us'); setcookie("lName", $_REQUEST["lastName"], time()+3600*24, '/', '.zest4life.us'); setcookie("email", $_REQUEST["email"], time()+3600*24, '/', '.zest4life.us'); setcookie("Hphone", $_REQUEST["homePhone"], time()+3600*24, '/', '.zest4life.us'); setcookie("Mphone", $_REQUEST["mobilePhone"], time()+3600*24, '/', '.zest4life.us'); setcookie("contact", $_REQUEST["prefContact"], time()+3600*24, '/', '.zest4life.us'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Zest 4 Life</title> <link href="../css/index_1.css" rel="stylesheet" type="text/css" /> </head> <body> <?php $blank = ""; $fname = $_REQUEST["firstName"]; $lname = $_REQUEST["lastName"]; $email = $_REQUEST["email"]; $Hphone = $_REQUEST["homePhone"]; $Mphone = $_REQUEST["mobilePhone"]; $contact = $_REQUEST["prefContact"]; ?> <div id="wrapper"> <div id="tb_margin" class="top"></div> <div id="form_mar"></div> <div id="logo" class="Hldr"></div> <div id="logo" class="Cntr"></div> <div id="logo" class="Rt"></div> <div id="Frm" class="fr"> </div> <div id="Frm" class="fr1"> <font size="2px" color=#ff0000> <? $errorCount = 0; /*Check for blank fields */ if($fname == $blank){ echo nl2br("Please enter your first name.\n"); $errorCount += 1; } if($lname == $blank){ echo nl2br("Please enter your last name.\n"); $errorCount += 1; } if($email == $blank){ echo nl2br("Please enter your email address.\n"); $errorCount += 1; } if($Hphone == $blank){ echo nl2br("Please enter your home phone number.\n"); $errorCount += 1; } if($Mphone == $blank){ echo nl2br("Please enter your mobile phone number.\n"); $errorCount += 1; } if($contact == "Preferred Contact"){ echo nl2br("Please select your preferred method of contact.\n"); $errorCount += 1; } /* Validated Email Address */ if(!filter_var($email, FILTER_VALIDATE_EMAIL)){ echo nl2br("Please enter a valid email address.\n"); $errorCount += 1; } if($errorCount == 1){ echo "Please use the back button to correct the above error."; exit; } if($errorCount > 1){ echo "Please use the back button to correct the above errors."; exit; } ?> <script type="text/javascript"> var errorCount = <?= "$errorCount"?>; <!-- function sndMail(){ window.location="http://www.zest4life.us/PHP/Z4L_Snd.php"; } //--> if(errorCount == 0){ document.write("Your information is being processed. Thank you for your time."); setTimeout(sndMail,5000); } </script> </font> </div> <div id="tb_margin" class="bottom"> </div> </div> Specifically it is the <div id="tb_margin" class="bottom"> </div> that is not showing up. ideas? Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/ Share on other sites More sharing options...
Mahngiel Posted June 12, 2012 Share Posted June 12, 2012 if the CSS for 'tb-margin' only has a background-image, it also needs a height/width or it'll revert to 0. Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353147 Share on other sites More sharing options...
PadLock Posted June 12, 2012 Author Share Posted June 12, 2012 Unfortunately that is not the case as .top and .bottom are both classes of #tb_margin which has the height and width already defined. Here is the code for them. #tb_margin { width:960px; height:35px; float:left; } #tb_margin.top { background-image:url(../images/Z4L_02.jpg); background-position:bottom; } #tb_margin.bottom { background-image:url(../images/Z4L_21.jpg); background-position:top; } I really wish it was something that simple but I am entirely at a loss as to why this is behaving in the manner that it is. I'm also attaching a screenshot to make it a little more clear what it is that i am talking about. Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353195 Share on other sites More sharing options...
Mahngiel Posted June 12, 2012 Share Posted June 12, 2012 got a link so Firebug can come to the rescue? Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353220 Share on other sites More sharing options...
PadLock Posted June 12, 2012 Author Share Posted June 12, 2012 http://www.zest4life.us/index_1.html Just make sure to leave a form blank so it will stop on the page with the display issue. Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353267 Share on other sites More sharing options...
Mahngiel Posted June 12, 2012 Share Posted June 12, 2012 When you tell PHP to exit, it stops all functionality, including the rendering of the rest of the HTML. This is why your page is incomplete. Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353274 Share on other sites More sharing options...
PadLock Posted June 12, 2012 Author Share Posted June 12, 2012 My hero. Thank you. I'm a bit new to PHP so I keep finding out neat little quirks like that. By neat little quirks I mean things that make me want to throw my laptop across my office. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353326 Share on other sites More sharing options...
floridaflatlander Posted June 12, 2012 Share Posted June 12, 2012 Also it sometimes helps to run you html source through http://validator.w3.org. It will tell you if you have missing or open tags. Quote Link to comment https://forums.phpfreaks.com/topic/264021-div-refuses-to-show/#findComment-1353330 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.