Jump to content

gregaryb

Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

392 profile views

gregaryb's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. My attempt to use PHPMail has failed since I have no idea how to install a github library in CPANEL. It seems as though CPANEL is wedded to PEAR package and mail2 and mime php libraries are available as PEAR packages and easy to install. And they seem to do more or less the same job as PHPMail. However how the buggery do you make them work???? If I insert any of this sample code in my web page I get various errors about unable to open streams due to the include statements or unknown identifiers (e.g. Mail_mime) if I leave out the include statements. <?php include 'Mail.php'; include 'Mail/mime.php' ; $text = 'Text version of email'; $html = '<html><body>HTML version of email</body></html>'; $file = '/home/richard/example.php'; $crlf = "\n"; $hdrs = array( 'From' => 'you@yourdomain.com', 'Subject' => 'Test mime message' ); $mime = new Mail_mime(array('eol' => $crlf)); $mime->setTXTBody($text); $mime->setHTMLBody($html); $mime->addAttachment($file, 'text/plain'); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail =& Mail::factory('mail'); $mail->send('postmaster@localhost', $hdrs, $body); ?>
  2. I did see that but same problem......can't find any sample code that does not generate an error along the lines that it can't find PHPmailer. Is PHPMailer native to php or is it something additional you have to install or enable on the back end.....in one's CPanel?
  3. I give up in frustration! I need some sample code to send an email with an attachment, using the function mail(...), that does not generate this error message: Error with PHP mail(): Multiple or malformed newlines found in additional_header
  4. I have done this with text file before but I can't gt it to work with a binary file. I am trying to send a .xls file and this is what I am getting when I open up the file attachment in MS Excel: UEsDBBQAAAAIACtT8ERHkkSyWAEAAPAEAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbK2UTU7DMBCF 95wi8hYlblkghJp2QWEJlSgHMPakserYlmf6d3smaQsIiUDVbmJF9nvf+Hns0WTbuGwNCW3wpRgW A5GB18FYvyjF2/wpvxMZkvJGueChFDtAMRlfjea7CJix2GMpaqJ4LyXqGhqFRYjgeaYKqVHEv2kh o9JLtQB5MxjcSh08gaecWg8xHr0wP1kD2UwlelYNY+TWSWI32H+HBfuJ7GEvbNmlUDE6qxVx4XLt zQ9qHqrKajBBrxqWFJ3NdesifwUi7Rzg2SiMCZTBGoAaV+xNj+QpVGrlKHvcsvs+8wQOT+MdwixY 2a3B2sY+Qv+GftetzwyC9dOkNtxKPaFvQlq+h7C8dOztWDTK+r5DZ/EshYiSUWcXAG1yBkwe2RIS 2a9j72XrkOB0+LEJWvU/iYe0u2hQdsPwwrF/+v911WqVwLxS4ua4+I377n2sQ3YP1vgDUEsDBBQA AAAIACtT8EQXtjc46QAAAEsCAAALAAAAX3JlbHMvLnJlbHOtks1qwzAMgO97CqN7o7SFMUadXsqg tzKyB9Bs5YcklrG9LX37eYexBbrSw46WpU+fhHb7eRrVO4fYi9OwLkpQ7IzY3rUaXuqn1QOomMhZ GsWxhjNH2Fd3u2ceKeWa2PU+qgxxUUOXkn9EjKbjiWIhnl3+aSRMlPIztOjJDNQybsryHsNvBlQL pjpaDeFot6Dqs+db2NI0veGDmLeJXbrQAnlO7CzblQ+5PqQ+D6NqCi0nDVbMKYcjkvdFRgNeNtrc bvT3tDhxIkuJ0Ejg6z5fGdeE1v+5omXGj8084oeE4VVk+HbBxQ1Un1BLAwQUAAAACAArU/BEhCSx VukAAAC5AgAAGgAAAHhsL19yZWxzL3dvcmtib29rLnhtbC5yZWxzrZLBasMwEETv/Qqx91p2Wkop kXMpgVxb9wOEtLZMbEloN23991UbSBwIoQefxKzYmcdI6833OIhPTNQHr6AqShDoTbC97xR8NNv7 Here is my code: $strEmailBody = "<html><body><table border="0" width="800px" cellspacing="0" cellpadding="0">". " <tr>". " <td width="25%" rowspan="5" valign="middle" style="border-style:solid;border-width:thin;border-color:#000000;">". " <p align="right"><b>BILLING DETAILS:</b></td>". " <td colspan="3" style="border-style:solid solid none none;border-width:thin;border-color:#000000;padding-left:5px;" align="left">".$_SESSION["GivenNames"]." ".$_SESSION["Surname"]."</td>". " </tr>". " <tr>". " <td colspan="3" style="border-style:none solid none none;border-width:thin;border-color:#000000;padding-left:5px;" align="left">".$_SESSION["Address"]."</td>". " </tr>". " <tr>". " <td width="9%" align="right">". " <b>Phone:</b></td>". " <td colspan="2" style="border-style:none solid none none;border-width:thin;border-color:#000000;" align="left">".$_SESSION["Phone"]."</td>". " </tr>". " <tr>". " <td width="9%" align="right">". " <b>Mobile:</b></td>". " <td colspan="2" style="border-style:none solid none none;border-width:thin;border-color:#000000;" align="left">".$_SESSION["Mobile"]."</td>". " </tr>". " <tr>". " <td width="9%" align="right" style="border-style:none none solid none;border-width:thin;border-color:#000000;">". " <b>Email:</b></td>". " <td colspan="2" style="border-style:none solid solid none;border-width:thin;border-color:#000000;" align="left">".$_SESSION["Email"]."</td>". " </tr>". "</table>". "<br>". "<table border="0" width="800px" cellspacing="0" cellpadding="0">". " <tr>". " <td width="25%" rowspan="5" align="right" valign="middle" style="border-style:solid;border-width:thin;border-color:#000000;">". " <b>DELIVERY DETAILS:</b></td>". " <td colspan="3" style="border-style:solid solid none none;border-width:thin;border-color:#000000;padding-left:5px;" align="left">".$_SESSION["RecGivenNames"]." ".$_SESSION["RecSurname"]."</td>". " </tr>". " <tr>". " <td colspan="3" style="border-style:none solid none none;border-width:thin;border-color:#000000;padding-left:5px;" align="left">".$_SESSION["RecAddress"]."</td>". " </tr>". " <tr>". " <td width="9%" align="right">". " <b>Phone:</b></td>". " <td colspan="2" style="border-style:none solid none none;border-width:thin;border-color:#000000;" align="left">".$_SESSION["RecPhone"]."</td>". " </tr>". " <tr>". " <td width="9%" height="24" align="right">". " <b>Mobile:</b></td>". " <td colspan="2" style="border-style:none solid none none;border-width:thin;border-color:#000000;" height="24" align="left">".$_SESSION["RecMobile"]."</td>". " </tr>". " <tr>". " <td width="9%" align="right" style="border-style:none none solid none;border-width:thin;border-color:#000000;">". " <b>Email:</b></td>". " <td colspan="2" style="border-style:none solid solid none;border-width:thin;border-color:#000000;" align="left">".$_SESSION["RecEmail"]."</td>". " </tr>". "</table>". "<br>". "<table border="0" width="800px" cellspacing="0" cellpadding="0" bordercolor="#000000">". " <tr>". " <td width="49%" align="left" style="border-style:solid none solid solid;border-width:thin;border-color:#000000;"><b>ITEM DESCRIPTION</b></td>". " <td width="17%" align="right" style="border-style:solid none solid solid;border-width:thin;border-color:#000000;">". " <b>UNIT PRICE</b></td>". " <td width="17%" align="right" style="border-style:solid none solid solid;border-width:thin;border-color:#000000;">". " <b>QUANTITY</b></td>". " <td width="17%" align="right" style="border-style:solid solid solid solid;border-width:thin;border-color:#000000;">". " <b>SUB_TOTAL</b></td>". " </tr>". $fTotal = 0; for ($nI = 0; $nI < count($_SESSION["arrayShoppingCart"]); $nI++) { $arrayCartItem = $_SESSION["arrayShoppingCart"][$nI]; $nCategoryIndex = $arrayCartItem["CategoryIndex"]; $strCategory = $_SESSION["arrayCategories"][$nCategoryIndex][0]; $nInventoryIndex = $arrayCartItem["ItemIndex"]; $arrayInventoryItem = $_SESSION["arrayInventory"][$strCategory][$nInventoryIndex]; $strEmailBody .= " <tr>". " <td width="44%" style="border-style:none none none solid;border-width:thin;border-color:#000000;">".$arrayInventoryItem["Description"]."</td>". " <td width="16%" align="right" style="border-style:none none none solid;border-width:thin;border-color:#000000;">".sprintf("$%.2f", $arrayInventoryItem["Price"])."</td>". " <td width="16%" align="right" style="border-style:none none none solid;border-width:thin;border-color:#000000;">".$arrayCartItem["Quantity"]."</td>". " <td width="16%" align="right" style="border-style:none solid none solid;border-width:thin;border-color:#000000;">".sprintf("$%.2f", $arrayInventoryItem["Price"] * $arrayCartItem["Quantity"])."</td>". " </tr>"; $fTotal += $arrayInventoryItem["Price"] * $arrayCartItem["Quantity"]; } $strEmailBody .= " <tr>". " <td width="76%" align="right" colspan="3" style="border-style:solid solid none solid;border-width:thin;border-color:#000000;">". " <b>SUB-TOTAL</b></td>". " <td width="16%" align="right" style="border-style:solid solid none solid;border-width:thin;border-color:#000000;">".sprintf("$%.2f", $fTotal)."</td>". " </tr>". " <tr>". " <td width="76%" align="right" colspan="3" style="border-style:solid solid none solid;border-width:thin;border-color:#000000;">". " <b>POSTAGE & HANDLING</b></td>". " <td width="16%" align="right" style="border-style:solid solid none solid;border-width:thin;border-color:#000000;">".sprintf("$%.2f", $_SESSION["PostageHandling"])."</td>". " </tr>". " <tr>". " <td width="76%" colspan="3" align="right" style="border-style:solid solid solid solid;border-width:thin;border-color:#000000;"><b>TOTAL</b></td>". " <td width="16%" align="right" style="border-style:solid solid solid none;border-width:thin;border-color:#000000;">".sprintf("$%.2f", $fTotal + $_SESSION["PostageHandling"])."</td>". " </tr>". "</table></body></html>"; mail($_SESSION["BusinessEmail"], "Order from ".$_SESSION["BusinessName"], $strEmailBody, getHeader($strEmailBody)); } Function getHeader(...) function getHeader($strEmailBody) { // Get a random 32 bit number using time() as seed. $nRandNum = md5(uniqid(time())); $strEmailHeader = "From: ".$_SESSION["GivenNames"]." ".$_SESSION["Surname"]." <".$_SESSION["Email"].">rn"; $strEmailHeader .= "Reply-To: ".$_SESSION["Email"]."rn"; $strEmailHeader .= "MIME-Version: 1.0rn"; $strEmailHeader .= "Content-Type: multipart/mixed; boundary="".$nRandNum.""rnrn"; $strEmailHeader .= "This is a multi-part message in MIME format.rn"; $strEmailHeader .= "--".$nRandNum."rn"; $strEmailHeader .= "Content-type:text/html; charset=UTF-8rn"; $strEmailHeader .= $strEmailBody."rnrn"; $strEmailHeader .= "--".$nRandNum."rn"; $strEmailHeader .= "Content-Type: application/octet-stream; name="Invoice.xlsx"rn"; // use different content types here $strEmailHeader .= "Content-Transfer-Encoding: 7bitrn"; $strEmailHeader .= "Content-Disposition: attachment; filename="Invoice.xls"rnrn"; $strEmailHeader .= getInvFileData($_SESSION["Surname"])."rnrn"; $strEmailHeader .= "--".$nRandNum."--"; return $strEmailHeader; } Function getInvFileData(...) function getInvFileData($strSurname) { $strInvFileName = "Invoice_".$strSurname.".xls"; echo "/*"; if (copy("BlankInvoice.xls", $strInvFileName)) { echo "*/r"; try { $objPHPExcel = PHPExcel_IOFactory::load($strInvFileName); $objPHPExcel->setActiveSheetIndexByName("Invoice"); } catch(Exception $e) { die('Error loading file "'.pathinfo($strInvFileName, PATHINFO_BASENAME).'": '.$e->getMessage()); } addInvDetails($objPHPExcel->getActiveSheet()); $objPHPExcelWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Excel2007"); $objPHPExcelWriter->save($strInvFileName); $_SESSION["BUFFER"] = file_get_contents($strInvFileName); $_SESSION["BUFFER_SIZE"] = filesize($strInvFileName); //unlink($strInvFileName); } else { echo "*/r"; echo "document.write("<p><font size='10'>ERROR: 'BlankInvoice.xls' could not be found...</font></p><br>");r"; } return chunk_split(base64_encode($_SESSION["BUFFER"])); }
  5. No I didn't spot that reply but thanks anyway. After a short stint writing some user documentation (as a programmer), at my last IT job some years ago, I realised why programmers generally make such poor manual writers. I had to totally change my mindset in order to make the documentation of any use to the testers. The Paypal developer website epitomises 'programmer' designed documentation unfortunately...
  6. For something that is now, in hindsight, very simple to implement, all this namespace business seems, to me, to be completely unnecessary layers of complexity.
  7. This (in written form) is what paypal needs to put on their developer website: https://www.youtube.com/watch?v=t_7GA1BZXPs This makes sense to me, and now I have an understanding of how the whole express checkout process works. But it wasn't easy to find and only after several very frustrating blind attempts with other sdk and class packages from github. After this Paypals details on key/value pairs now means something to me. Hope it helps others who are experiencing the same frustration that I have had to endure over the past week.
  8. For christ sake can some one PLEASE point me in the direction of SIMPLE paypal integration system that DOES NOT require bloody Composer, or any other irritating baggage. And that does not have components scattered across GitHub in multiple zip files. And that can be used via one SIMPLE include statement. I found this https://github.com/paypal/rest-api-sdk-php. Great! Except that it uses PHP "uses" statements and my web server's version of PHP apparently does not support it. So I proceeded to replace all the "uses' statements with explicit "requires" statements so that I don't have to use Composer. Which I find impossible to figure out how to use properly. And I simply don't want to have to use it because it adds unnecessary layers of complexity when a simple include or requires statement would suffice. I then discovered this problem in all the files in the folder "Api". All the files contain this at the top: use PayPalCommonPPModel;use PayPalRestApiContext; I found "RestApiContext" in the file "RestApiContext.php" - no problem. But where the buggery is "CommonPPModel" - its not included in the zip file. WHY the ###### would you not include this in the zip file given that it is in a requires statement? And where the ###### is it?
  9. https://getcomposer.org/doc/01-basic-usage.md Where do you type one of these? curl -sS https://getcomposer.org/installer | php or if you don't have curl php -r "readfile('https://getcomposer.org/installer');" | php In the top of a web page between <?php ?>? In your web hosting service account login some where?
  10. I worked out a javascript solution but I can't figure out how to do it with just CSS. <nav class="navigation"> <ul class="NavMenu"> <li class="NavMenuItem"><a href="index.php">Home</a></li> <li class="NavMenuItem"><a href="CompanyProfile.php">Company Profile</a></li> <li class="NavMenuItem"><a href="Contact.php">Contact Details</a></li> <li class="NavMenuItem"><a href="Store.php">Store</a> <div class="NavMenuItemArrow"><a href="#" id="NavMenuItemArrow" onclick="doOnClick('NavMenuItemArrow', 'NavSubmenu')">▼</a> <ul class="NavSubmenu" id="NavSubmenu"> <li class="NavMenuItem"><a href="Category1.php">Comparators</a></li> <li class="NavMenuItem"><a href="Category2.php">LDR</a></li> <li class="NavMenuItem"><a href="Category3.php">LED</a></li> <li class="NavMenuItem"><a href="Category4.php">Operational Amplifiers</a></li> <li class="NavMenuItem"><a href="Category5.php">Phototransistor</a></li> <li class="NavMenuItem"><a href="Category6.php">Potentiometer</a></li> <li class="NavMenuItem"><a href="Category7.php">Rectifier Diodes</a></li> <li class="NavMenuItem"><a href="Category8.php">Resistor</a></li> <li class="NavMenuItem"><a href="Category9.php">Schottky Diodes</a></li> <li class="NavMenuItem"><a href="Category10.php">Transitors NPN</a></li> <li class="NavMenuItem"><a href="Category11.php">Transistors PNP</a></li> <li class="NavMenuItem"><a href="Category12.php">Zener Diodes</a></li> </ul> </div> </li> </ul> <div id="Gap" style="display:none;"> <?php for ($nI = 0; $nI < count($_SESSION["arrayCategories"]); $nI++) echo "<p> </p>r"; ?> </div> <div class="NavImage" id="NavImg1"> <img width="100%" alt="Navigation image 1" src="images/NavigationImage1.jpg" /> </div> <div class="NavImage" id="NavImg2"> <img width="100%" alt="Navigation image 2" src="images/NavigationImage2.jpg" /> </div></nav><script type="text/javascript"> function doOnClick(strArrowLinkID, strSubmenuID) { var ArrowLinkField = document.getElementById(strArrowLinkID); var Submenu = document.getElementById(strSubmenuID); var Gap = document.getElementById("Gap"); var Content = document.getElementById("content"); var strText = ArrowLinkField.innerHTML; var strDown = String.fromCharCode(0x25BC); var strUp = String.fromCharCode(0x25B2); if (strText == strDown) { ArrowLinkField.innerHTML = strUp; Submenu.style = "display:block;position:relative;"; Gap.style = "display:block;position:relative;"; Content.style.height = "<?php echo $nContainerMinHeight + (count($_SESSION["arrayCategories"]) * $nButtonHeight * 1.5); ?>px"; } else { ArrowLinkField.innerHTML = strDown; Submenu.style = "display:none;"; Gap.style = "display:none;"; Content.style.height = "<?php echo $nContainerMinHeight; ?>px"; } } </script>
  11. See attached images. Or here is the website if you want to play with it: http://www.gregsindigenouslandscapes.com.au/EasyWebStore/index.php# It may make it a little easier to view the source without the PHP. I have a nav menu on the left where one of the items has a little arrow. When you click the arrow a popup menu appears below it. If you click it again the popup menu disappears. The problem is the popup menu is displaying over the top of an image below the nav menu. I would prefer it to push the images down but I can't figure out how to do this. HTML <nav class="navigation"> <ul class="NavMenu"> <li class="NavMenuItem"><a href="index.php">Home</a></li> <li class="NavMenuItem"><a href="CompanyProfile.php">Company Profile</a></li> <li class="NavMenuItem"><a href="Store.php">Store</a> <div class="NavMenuItemArrow"><a href="#" id="NavMenuItemArrow" onclick="doOnClick('NavMenuItemArrow', 'NavSubmenu')">▼</a> <ul class="NavSubmenu" id="NavSubmenu"> <li class="NavMenuItem"><a href="Category1.php">Comparators</a></li> <li class="NavMenuItem"><a href="Category2.php">LDR</a></li> <li class="NavMenuItem"><a href="Category3.php">LED</a></li> <li class="NavMenuItem"><a href="Category4.php">Operational Amplifiers</a></li> <li class="NavMenuItem"><a href="Category5.php">Phototransistor</a></li> <li class="NavMenuItem"><a href="Category6.php">Potentiometer</a></li> <li class="NavMenuItem"><a href="Category7.php">Rectifier Diodes</a></li> <li class="NavMenuItem"><a href="Category8.php">Resistor</a></li> <li class="NavMenuItem"><a href="Category9.php">Schottky Diodes</a></li> <li class="NavMenuItem"><a href="Category10.php">Transitors NPN</a></li> <li class="NavMenuItem"><a href="Category11.php">Transistors PNP</a></li> <li class="NavMenuItem"><a href="Category12.php">Zener Diodes</a></li> </ul> </div> </li> </ul> <div class="NavImage"> <img width="100%" alt="Navigation image 1" src="images/NavigationImage1.jpg" /> </div> <div class="NavImage"> <img width="100%" alt="Navigation image 2" src="images/NavigationImage2.jpg" /> </div> </nav><script type="text/javascript"> function doOnClick(strArrowLinkID, strSubmenuID) { var ArrowLinkField = document.getElementById(strArrowLinkID); var Submenu = document.getElementById(strSubmenuID); var strText = ArrowLinkField.innerHTML; var strDown = String.fromCharCode(0x25BC); var strUp = String.fromCharCode(0x25B2); if (strText == strDown) { ArrowLinkField.innerHTML = strUp; Submenu.style = "display:block;"; } else { ArrowLinkField.innerHTML = strDown; Submenu.style = "display:none;"; } } </script> CSS /*************************/ /* Navigation submenu */ /*************************/ .NavSubmenu{ behavior:url(CSSPie/PIE.htc); display:none; list-style-type:none; position:relative; z-index:999; background-color:#<?php echo $_SESSION["ContainerColor"]; ?>; width:<?php echo $nNavigationWidth - 2; ?>px; left:-<?php echo $nNavigationWidth - 16; ?>px; top:-10px; padding:0px 0px 0px 0px; overflow:hidden; border-style:solid; border-width:thin; border-color:transparent; } li > div > a + ul > li > a{ behavior:url(CSSPie/PIE.htc); display:block; position:relative; background-color:#<?php echo $_SESSION["LinkColor"]; ?>; color:#<?php echo $_SESSION["LinkFontColor"]; ?>; font-family:<?php echo $_SESSION["LinkFont"]; ?>; font-size:medium; text-align:left; margin-left:20px; padding-left:2px; width:<?php echo $nButtonWidth - 20; ?>px; height:<?php echo $nButtonHeight; ?>px; line-height:<?php echo $nButtonHeight; ?>px; vertical-align:middle; top:0px; left:0px; border-radius:3px; border-style:solid; border-width:thin; border-color:#<?php echo $_SESSION["ContainerColor"]; ?>; } li > div > a + ul > li > a:hover, li > div > a + ul > li > a:active{ behavior:url(CSSPie/PIE.htc); display:block; position:relative; background-color:#<?php echo $_SESSION["HoverLinkColor"]; ?>; color:#<?php echo $_SESSION["HoverLinkFontColor"]; ?>; font-family:<?php echo $_SESSION["HoverLinkFont"]; ?>; font-size:medium; text-align:left; margin-left:20px; padding-left:2px; width:<?php echo $nButtonWidth - 20; ?>px; height:<?php echo $nButtonHeight; ?>px; line-height:<?php echo $nButtonHeight; ?>px; vertical-align:middle; top:0px; left:0px; border-radius:3px; border-style:solid; border-width:thin; border-color:#<?php echo $_SESSION["HoverLinkFont"]; ?>; } /*************************/ /* Navigation image */ /*************************/ .NavImage{ behavior: url(CSSPie/PIE.htc); display:block; position:relative; border-style:solid; border-radius:5px; border-top-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-left-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-bottom-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; border-right-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; width:90%; height:120%; margin-left:auto; margin-right:auto; margin-top:20px; overflow:hidden; }
  12. See attached images. I have a nav menu on the left where one of the items has a little arrow. When you click the arrow a popup menu appears below it. If you click it again the popup menu disappears. The problem is the popup menu is displaying over the top of an image below the nav menu. I would prefer it to push the images down but I can't figure out how to do this. HTML <nav class="navigation"> <ul class="NavMenu"> <li class="NavMenuItem"><a href="index.php">Home</a></li> <li class="NavMenuItem"><a href="CompanyProfile.php">Company Profile</a></li> <li class="NavMenuItem"><a href="Store.php">Store</a> <div class="NavMenuItemArrow"><a href="#" id="NavMenuItemArrow" onclick="doOnClick('NavMenuItemArrow', 'NavSubmenu')">▼</a> <ul class="NavSubmenu" id="NavSubmenu"> <li class="NavMenuItem"><a href="Category1.php">Comparators</a></li> <li class="NavMenuItem"><a href="Category2.php">LDR</a></li> <li class="NavMenuItem"><a href="Category3.php">LED</a></li> <li class="NavMenuItem"><a href="Category4.php">Operational Amplifiers</a></li> <li class="NavMenuItem"><a href="Category5.php">Phototransistor</a></li> <li class="NavMenuItem"><a href="Category6.php">Potentiometer</a></li> <li class="NavMenuItem"><a href="Category7.php">Rectifier Diodes</a></li> <li class="NavMenuItem"><a href="Category8.php">Resistor</a></li> <li class="NavMenuItem"><a href="Category9.php">Schottky Diodes</a></li> <li class="NavMenuItem"><a href="Category10.php">Transitors NPN</a></li> <li class="NavMenuItem"><a href="Category11.php">Transistors PNP</a></li> <li class="NavMenuItem"><a href="Category12.php">Zener Diodes</a></li> </ul> </div> </li> </ul> <div class="NavImage"> <img width="100%" alt="Navigation image 1" src="images/NavigationImage1.jpg" /> </div> <div class="NavImage"> <img width="100%" alt="Navigation image 2" src="images/NavigationImage2.jpg" /> </div> </nav><script type="text/javascript"> function doOnClick(strArrowLinkID, strSubmenuID) { var ArrowLinkField = document.getElementById(strArrowLinkID); var Submenu = document.getElementById(strSubmenuID); var strText = ArrowLinkField.innerHTML; var strDown = String.fromCharCode(0x25BC); var strUp = String.fromCharCode(0x25B2); if (strText == strDown) { ArrowLinkField.innerHTML = strUp; Submenu.style = "display:block;"; } else { ArrowLinkField.innerHTML = strDown; Submenu.style = "display:none;"; } } </script> CSS /*************************/ /* Navigation submenu */ /*************************/ .NavSubmenu{ behavior:url(CSSPie/PIE.htc); display:none; list-style-type:none; position:relative; z-index:999; background-color:#<?php echo $_SESSION["ContainerColor"]; ?>; width:<?php echo $nNavigationWidth - 2; ?>px; left:-<?php echo $nNavigationWidth - 16; ?>px; top:-10px; padding:0px 0px 0px 0px; overflow:hidden; border-style:solid; border-width:thin; border-color:transparent; } li > div > a + ul > li > a{ behavior:url(CSSPie/PIE.htc); display:block; position:relative; background-color:#<?php echo $_SESSION["LinkColor"]; ?>; color:#<?php echo $_SESSION["LinkFontColor"]; ?>; font-family:<?php echo $_SESSION["LinkFont"]; ?>; font-size:medium; text-align:left; margin-left:20px; padding-left:2px; width:<?php echo $nButtonWidth - 20; ?>px; height:<?php echo $nButtonHeight; ?>px; line-height:<?php echo $nButtonHeight; ?>px; vertical-align:middle; top:0px; left:0px; border-radius:3px; border-style:solid; border-width:thin; border-color:#<?php echo $_SESSION["ContainerColor"]; ?>; } li > div > a + ul > li > a:hover, li > div > a + ul > li > a:active{ behavior:url(CSSPie/PIE.htc); display:block; position:relative; background-color:#<?php echo $_SESSION["HoverLinkColor"]; ?>; color:#<?php echo $_SESSION["HoverLinkFontColor"]; ?>; font-family:<?php echo $_SESSION["HoverLinkFont"]; ?>; font-size:medium; text-align:left; margin-left:20px; padding-left:2px; width:<?php echo $nButtonWidth - 20; ?>px; height:<?php echo $nButtonHeight; ?>px; line-height:<?php echo $nButtonHeight; ?>px; vertical-align:middle; top:0px; left:0px; border-radius:3px; border-style:solid; border-width:thin; border-color:#<?php echo $_SESSION["HoverLinkFont"]; ?>; } /*************************/ /* Navigation image */ /*************************/ .NavImage{ behavior: url(CSSPie/PIE.htc); display:block; position:relative; border-style:solid; border-radius:5px; border-top-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-left-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-bottom-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; border-right-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; width:90%; height:120%; margin-left:auto; margin-right:auto; margin-top:20px; overflow:hidden; }
  13. It is bloody Epression Web causing these problems. Even though I am not using Expression Web to edit my .css file it still keeps trying to re-format the code. Often when I try to save the .css in notepad.exe I get a message saying the file has changed and do I want to re-load it. Occasionally I have hit the wrong response and then I find all my css/php code $%&@# up. Then it takes me ages to get it all working again. The single quote was probably a result of this. I ended up having to remove all the CSS code and then put it back one bit at a time until I found all the damn errors that expression web had introduced. Windows notepad.exe has it own problems. e.g. poor undo/redo I have since discovered notepad plus and notepad2.
  14. I am in the process of getting rid of all my ids and switching to classes. But I am now having trouble getting my popup menu working again. When the mouse hovers over the <a></a> element in blue, I want to select the <div></div> element in green. But this CSS code does not work li > a:hover div{....} li > a:hover + div{....} So what is the correct way to select this element? I also wish to select this element <div class="NavSubMenuBalloon"> <div class="navigation"> <ul class="NavMenu"> <li class="NavMenuItem"><a href="index.php">Home</a></li> <li class="NavMenuItem"><a href="CompanyProfile.php">Company Profile</a></li> <li class="NavMenuItem"><a href="Store.php">Store</a><div class="NavSubMenuArrow">▸</div> <div class="NavSubMenuBalloon"> <div class="NavBalloonArrow"></div> <ul class="NavSubMenu"> <li class="NavMenuItem"><a href="Category1.php">Comparators</a></li> <li class="NavMenuItem"><a href="Category2.php">LDR</a></li> <li class="NavMenuItem"><a href="Category3.php">LED</a></li> <li class="NavMenuItem"><a href="Category4.php">Operational Amplifiers</a></li> <li class="NavMenuItem"><a href="Category5.php">Phototransistor</a></li> <li class="NavMenuItem"><a href="Category6.php">Potentiometer</a></li> <li class="NavMenuItem"><a href="Category7.php">Rectifier Diodes</a></li> <li class="NavMenuItem"><a href="Category8.php">Resistor</a></li> <li class="NavMenuItem"><a href="Category9.php">Schottky Diodes</a></li> <li class="NavMenuItem"><a href="Category10.php">Transitors NPN</a></li> <li class="NavMenuItem"><a href="Category11.php">Transistors PNP</a></li> <li class="NavMenuItem"><a href="Category12.php">Zener Diodes</a></li> </ul> </div> </li> </ul> <div class="NavImage"> <img width="100%" alt="Navigation image 1" src="images/NavigationImage1.jpg" /> </div> <div class="NavImage"> <img width="100%" alt="Navigation image 2" src="images/NavigationImage2.jpg" /> </div></div>
  15. I have made some change to cause two of my <div> to not display no matter what I do with the CSS. And I don't understand what change has caused it. #content and #navigation wont display no matter what I do. Screen shot of the resulting web page is attached. The container, header structure and footer structure are there but no navigation div nor content div. It may be that Expression web has stuffed something up in CSS but I can't see the problem. Expression web is a pain in the arse with CSS if you put in php code in with it - it just keeps re-arranging the code and causing PHP syntax errors and CSS screw ups. I fixed all the PHP syntax errors but....... HTML <?php header('Content-Type: text/html; charset=utf8'); session_start(); include "Inventory.php"; include "Browser.php";?><!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>Home</title> <?php include "Style.css"; ?> <script type="text/javascript"> <?php if (isOldBrowser()) { include "html5shiv.js"; } ?> </script> </head> <body> <div id="container"> <?php include "Header.htm"; ?> <div id="columns"> <?php include "NavigationStructure.htm"; ?> <div id="content"> <?php function getHitCount() { $nCount = 0; if ($file = fopen("Hits.txt", "r")) { $nCount = intval(fgets($file)); fclose($file); if (!$_SESSION["HitLogged"] && ($file = fopen("Hits.txt", "w"))) { fputs($file, strval($nCount + 1)); fclose($file); $_SESSION["HitLogged"] = true; } } return strval($nCount); } ?> <p id="PageTitle"> <script type="text/javascript"> document.write(document.title); </script> <span style="float:right;">Hits:<?php echo getHitCount(); ?></span> </p> <!--******************************************************************************************************************************************** ******************************************************************************************************************************************** Start main content ******************************************************************************************************************************************** ********************************************************************************************************************************************--> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p> <p>sffsdgfdgdfgdfg</p><!--******************************************************************************************************************************************** ******************************************************************************************************************************************** End main content ******************************************************************************************************************************************** ********************************************************************************************************************************************--> </div> </div> <?php include "Footer.htm"; ?> </div> </body></html> CSS /**********************************************************************************************************************/ /**********************************************************************************************************************/ /** Page structure **/ /**********************************************************************************************************************/ /**********************************************************************************************************************/ h1 { display:block; font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:3em; font-weight:bold; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px; text-decoration:underline; } h2 { display:block; position:relative; font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:xx-large; font-weight:bold; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px; text-decoration:underline; } h3 { display:block; font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:x-large; font-weight:bold; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px; text-decoration:underline; } h4 { display:block; font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:large; font-weight:bold; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px; text-decoration:underline; } h5 { display:block; font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:medium; font-weight:bold; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px; text-decoration:underline; } hr{ color:#<?php echo $_SESSION["ContainerColor"]; ?>; border-style:outset; border-width:medium; width:98%; } p { font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:medium; font-weight:normal; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px } ul { display:block; margin:12px } li { font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:medium; font-weight:normal; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; margin:12px } #container { behavior: url(CSSPie/PIE.htc); display:block; position:relative; width:<?php echo $nContainerWidth; ?>px; background-color:#<?php echo $_SESSION["ContainerColor"]; ?>; font-family:<?php echo $_SESSION[ContainerFont]; ?>; font-size:small; color:<?php echo $_SESSION["ContentsFontColor"]; ?>; text-align:left; border-radius:5px; border-top-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; border-left-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; border-bottom-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-right-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-left-style: solid; border-right-style: solid; border-top-style: solid; border-bottom-style: solid; } #columns{ display:none; width:100%; min-height:<?php echo $strContainerMinHeight; ?>; margin-top:0px; clear:both' border-style:solid; border-width:thin; border-color:yellow yellow yellow yellow; } #navigation{ display:block; /* position:relative; float:left; width:<?php echo $nNavigationWidth; ?>px; clear:right; margin-top:8px;*/ border-style:solid; border-width:thin; border-color:red red red red; } #content{ behavior: url(CSSPie/PIE.htc); display:block;/* position:relative; background-color:<?php echo $_SESSION["ContentsColor"]; ?>; float:left; width:80%; font-family:<?php echo $_SESSION["ContentsFont"]; ?>; font-size:small; color:black; text-align:left; border-radius:5px; border-top-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-left-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-bottom-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; border-right-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; min-height:<?php echo $strContainerMinHeight; ?>; border-left-style: solid; border-right-style: solid; border-top-style: solid; border-bottom-style: solid;*/ } #footer { display:block; position:relative; clear:both; font-family:<?php echo $_SESSION[ "ContainerFont"]; ?>; font-size:medium; color:#<?php echo $_SESSION["ContainerFontColor"]; ?>; text-align:left; padding-left:260px; line-height:50px; vertical-align:middle; height:50px; margin-bottom:12px; border-style:solid; border-width:thin; border-color:red red red red; } #header { display:block; position:relative; top:-10px; width:100%; height:<?php echo $nHeaderHeight; ?>px; border-style:none; border-width:thin; } #heading { behavior: url(CSSPie/PIE.htc); display:block; position:relative; float:left; font-family:<?php echo $_SESSION["MainHeadingFont"]; ?>; font-size:4.5em; font-weight:bold; color:#<?php echo $_SESSION["MainHeadingColor"]; ?>; text-shadow:3px 3px 0px #<?php echo $_SESSION["MainHeadingShadowColor"]; ?>; width:<?php echo $nHeadingWidth; ?>px; height:100%; vertical-align:middle; line-height:100%; border-style:none; border-width:thin; } #motto{ behavior: url(CSSPie/PIE.htc); display:block; position:relative; font-family:<?php echo $_SESSION["MainHeadingFont"]; ?>; font-size:xx-large; font-weight:bold; color:#<?php echo $_SESSION["MainHeadingColor"]; ?>; text-shadow:2px 2px 0px #<?php echo $_SESSION["MainHeadingShadowColor"]; ?>; height:36px; line-height:36px; margin-top:10px; margin-bottom:10px; border-style:none; border-width:thin; } #ABN{ behavior: url(CSSPie/PIE.htc); display:block; position:relative; font-family:<?php echo $_SESSION["ContainerFont"]; ?>; font-size:medium; font-weight:bold; color:#<?php echo $_SESSION["ContainerFontColor"]; ?>; height:25px; line-height:25px; text-align:right; border-style:none; border-width:thin; } #HeaderImage{ behavior: url(CSSPie/PIE.htc); display:block; float:left; border-radius:5px; border-style:solid; border-top-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-left-color:#<?php echo $_SESSION["DarkEdgeContainerColor"]; ?>; border-bottom-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; border-right-color:#<?php echo $_SESSION["LightEdgeContainerColor"]; ?>; width:<?php echo $nContainerWidth - $nNavigationWidth - $nHeadingWidth + 26; ?>px; height:<?php echo $nHeaderImageHeight; ?>px; margin-top:auto; margin-bottom:auto; overflow:hidden; margin-left:10px; } #symbol{ behavior: url(CSSPie/PIE.htc); display:block; float:left; margin-left:10px; margin-right:10px; height:100%; line-height:100%; vertical-align:middle; overflow:hidden; border-style:none; border-width:thin; border-color:black; } #PageTitle { behavior: url(CSSPie/PIE.htc); display: block; color:#<?php echo $_SESSION["PageHeadingFontColor"]; ?>; font-family:<?php echo $_SESSION["PageHeadingFont"]; ?>; font-size:42px; font-weight:bold; text-shadow:2px 2px 0px #<?php echo $_SESSION["MainHeadingShadowColor"]; ?>; }
×
×
  • Create New...