Jump to content

gregaryb

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by gregaryb

  1. 1876 let g_arrayBooks = {}; 1877 g_arrayBooks["3,16,154"] = []; 1878 g_arrayBooks[3,16,154].push({title:"Harry Potter & the Philosopher's Stone",author:"J.K.Rowling",price:"0000000010",quantity:"1",weight:"0000000200",summary:"The novel introduces readers to the magical world of Hogwarts School of Witchcraft and Wizardry and follows the adventures of a young boy named Harry Potter. Harry Potter is an orphan who has been living with his cruel and neglectful relatives, the Dursleys, ever since his parents were killed by the dark wizard Lord Voldemort when he was just a baby. On his eleventh birthday, Harry receives a letter from a mysterious messenger informing him that he is a wizard and has been accepted to attend Hogwarts.",image_filename:""}); Uncaught TypeError: can't access property "push", g_arrayBooks[154] is undefined <anonymous> https://www.katescastle.com.au/admin.php:1878 WTF? 'g_arrayBooks[154]' DOES NOT EXIST on line 1878!
  2. The array is nested similar to this example. { "Students": [ { "Name":"Amit Goenka" , "Major":"Physics" }, { "Name":"Smita Pallod" , "Major":"Chemistry" }, { "Name":"Rajeev Sen" , "Major":"Mathematics" } ] } All I get is an empty string. Why? Do I really have to manually code my own function that PROPERLY converts my associative arrays to JSON? Or is there a better quality library some where that can include to convert my associative arrays? Damn nuisance! Associative array in firefox developer tools https://drive.google.com/file/d/1Ij0E_WgaHqU0qFXr8xWkp7Brj18T-Qic/view?usp=sharing
  3. This date comparison ALWAYS returns false and I have no idea why. if ($dateNow > $dateExpiry) $objectAdvertSpace->expired = "1"; else $objectAdvertSpace->expired = "0"; The two dates are created like this: $dateNow = new DateTime(); $dateExpiry = new DateTime($row["expiry_date"]); $dateAdded = new DateTime($row["date_added"]); The first instance of $row["expiry_date"] contains "2023-12-18" The second instance of $row["expiry_date"] contains "2025-02-26" Both are from two rows in a table in my MySQL database. $dateNow contains "2024-02-27" assuming $dateNow->format("Y-m-d"); Why the bloody is the comparison ($dateNow > $dateExpiry) resulting in $objectAdvertSpace->expired = "0" in both cases???? What am I missing????
  4. [0] => aes-128-cbc [1] => aes-128-cbc-hmac-sha1 [2] => aes-128-cbc-hmac-sha256 [3] => aes-128-ccm [4] => aes-128-cfb [5] => aes-128-cfb1 [6] => aes-128-cfb8 [7] => aes-128-ctr [9] => aes-128-gcm [10] => aes-128-ocb [11] => aes-128-ofb [12] => aes-128-xts [13] => aes-192-cbc [14] => aes-192-ccm [15] => aes-192-cfb [16] => aes-192-cfb1 [17] => aes-192-cfb8 [18] => aes-192-ctr [20] => aes-192-gcm [21] => aes-192-ocb [22] => aes-192-ofb [23] => aes-256-cbc [24] => aes-256-cbc-hmac-sha1 [25] => aes-256-cbc-hmac-sha256 [26] => aes-256-ccm [27] => aes-256-cfb [28] => aes-256-cfb1 [29] => aes-256-cfb8 [30] => aes-256-ctr [32] => aes-256-gcm [33] => aes-256-ocb [34] => aes-256-ofb [35] => aes-256-xts [36] => aria-128-cbc [37] => aria-128-ccm [38] => aria-128-cfb [39] => aria-128-cfb1 [40] => aria-128-cfb8 Possibilities above. The library: https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js
  5. This does not work - the form is ignoring the the transform. formFeedback.style.transform = "translate(100, 10000)"; Why would that be? What is it that you have to do to element CSS properties to get the element ot be able to be moved? .form { display: inline-block; position: relative; border-style: none; margin-right: var(--Margin); margin-top: var(--Margin); margin-bottom: var(--Margin); padding: 10px; background-color: var(--ColorMastheadBG); border-radius: var(--BorderRadius); } <form class="form" style="z-index:1;" id="feedback_form" method="post" action="" style="display:block;"> <table cellspacing="0" cellpadding="10" style="layout:fixed;width: 400px;"> <tr> <td style="text-align:right;"> Comments&nbsp; </td> <td colspan="2"> <textarea cols="64" name="textarea_comments" id="textarea_comments" rows="2" tabindex="3" maxlength="256"></textarea> </td> </tr> <tr> <td style="text-align:left;">&nbsp;</td> <td style="text-align:left;width:600px;"> <img alt="images/thumbs_up.png" src="images/thumbs_up.png" width="20"> <input checked="checked" name="feedback" id="radio_feedback_positive" tabindex="1" type="radio" value="true"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img alt="images/thumbs_down.png" src="images/thumbs_down.png" width="20"> <input name="feedback" id="radio_feedback_negative" tabindex="2" type="radio" value="false"> <td style="text-align:left;"> <input name="submit_feedback_edit" type="submit" value="SAVE"> </td> </td> </tr> </table> </form>
  6. I won't post my entire code as most of it is irrelevant to the problem. I have this index.php page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <!-- #BeginTemplate "master.dwt" --> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <!-- #BeginEditable "doctitle" --> <title>Home</title> <!-- #EndEditable --> <?php include "common.php"; ?> <?php include "common.js"; ?> <link href="styles/style.css" media="screen" rel="stylesheet" title="CSS" type="text/css" /> <style> body { color: #000; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; background-image: url('images/background.jpg'); background-position: center; background-repeat: no-repeat; background-size: 100%; } </style> <!-- #BeginEditable "page_styles" --> <style> </style> <!-- #EndEditable --> </head> <body onresize="SetPageContetHeight()"> <!-- Begin Masthead --> <div class="masthead" id="masthead"> <img class="logo" alt="" src="images/Tradie.png" width="90" /> <div class="title" id="title">FIND A TRADIE</div> <a class="masthead_button" href="new_tradie.php">TRADIE REGISTRATION</a> <a class="masthead_button" href="new_customer">CUSTOMER REGISTRATION</a> <a class="masthead_button" href="login.php">LOG IN</a> <div class="tag" id="tag">Created by an Australian tradie for Australians</div> <!-- Begin Navigation --> <nav class="navigation" id="navigation"> <a class="navigation_link" href="index.php">Home</a> <a class="navigation_link" href="benefits.php">Benefits</a> <a class="navigation_link" href="about.html">About</a> <?php if (isset($_SESSION["account_id"]) && ($_SESSION["account_id"] != "")) echo "<a class=\"navigation_link\" href=\"account.php\">Account</a>\n"; else echo "<a class=\"navigation_link\" href=\"login.php\">Login</a>\n"; ?> <a class="navigation_link" href="contact.html">FAQ</a> <a class="navigation_link" href="contact.html">Contact</a> </nav> <!-- End Navigation --> </div> <!-- Begin PageHeading --> <div id="page_heading"class="page_heading"><script type="text/javascript">document.write(document.title);</script></div> <!-- End PageHeading --> <!-- End Masthead --> <!-- Begin Page Content --> <div class="page_content" id="page_content"> <form class="advert_form" id="advert_form"> XXXXXXXXXXXXX </form> <div class="note" style="flex-wrap: wrap;"> <div> <h4>Both customers &amp; tradies need to register and login to use this service.</h4> <h5><a href="befits.php">Click here</a> to read the benefits of becoming a member of 'Find a tradie'.</h5> <h6>However you can give it a test run here...</h6> </div> <form method="post" action="index.php" style="width:745px"> <table class="table_no_borders"> <tr> <td style="text-align:right;" class="cell_no_borders"> <b>What type of tradie are you looking for?</b> </td> <td class="cell_no_borders"> &nbsp;&nbsp;&nbsp;<select id="select_trade" name="select_trade"> <?php DoGeneratePrimaryTradeOptions($_POST["select_trade"]); ?> </select> ..... Of issue is the form at the bottom that starts off as "display: none;" When I click a button else where on this page I want thos form to become visible but on top of all the other page elements. Here is the relevent CSS. .advert_form { display: none; position: relative; z-index: 999; background-color: LightSteelBlue; width: 1200px; height: 500px; border-radius: var(--BorderRadius); border-style: solid; border-width: medium; border-color: var(--NoteHeadingColor); } .page_heading { display: inline-block; position: relative; z-index: 0; background-color: var(--LinkColorBG); padding: 10px; border-radius: var(--BorderRadiusButton); margin-top: 10px; margin-left: 10px; color: var(--LinkColorText); font-family: Arial, Helvetica, sans-serif; font-size: x-large; font-weight: bold; text-decoration: underline; } .page_content { overflow: auto; position: relative; z-index: 0; } .note { /*display: block;*/ display: flex; flex-wrap: nowrap; position: relative; z-index: 0; /*background-color: rgba(255, 255, 255, 0.9);*/ background-color: var(--NoteColorBG); border-radius: 20px; padding: var(--Padding); margin-left: var(--Margin); margin-right: var(--Margin); margin-top: var(--Margin); margin-bottom: var(--Margin); /*box-shadow: 10px 10px rgba(0, 0, 0, 0.65);*/ box-shadow: 10px 10px rgb(0, 0, 0); border-style: solid; border-width: thick; border-color: var(--LinkColorBG); } No matter what I do with the position and z-index properties if surrounding elements, z-index: 999 on my form just does nothing. All the elements below the form are pushed down. So what else is it that I have to do to make it work as intended?
  7. That is definitely not that because I removed everything from my style.css except the body selector. And still the same problem - background image DOES NOT work from a a linked css file. It has got to be a bug!
  8. I don't see how. The only stuff I have beyond that is a .form thing and inputs related to that selector. Everything else is commented out.
  9. This make absolutely no sense! I have a simple web page: <!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 content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> <link href="styles/style.css" media="screen" rel="stylesheet" title="CSS" type="text/css" /> </head> <body> </body> </html> And I have this in my style.css: body { color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; background-image:url('images/background.jpg'); background-repeat:no-repeat; background-size:100em; height: 100em; width: 100em; background-color:aqua; } So why will the background color display just fine? But the background image just won't? However if I place the background image attributes in a style="..." property applied to my <body> tag then it shows up just fine. If I do this the image show up fine! <!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 content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> <link href="styles/style.css" media="screen" rel="stylesheet" title="CSS" type="text/css" /> <style> body { color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; background-image:url('images/background.jpg'); background-repeat:no-repeat; background-size:100em; } </style> </head> <body> </body> </html> So long as this: body { color: black; font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; background-image:url('images/background.jpg'); background-repeat:no-repeat; background-size:100em; } Is in the style sheet it just doesn't work. Why????
  10. I really over these things - can some one please just fix them for me so I can move on. At this point I am not interested in learning the syntax for regular expressions as used in a web browser. What is the problem with these? Unable to check <input pattern='^@\s]+@[^@\s]+\.[^@\s]+$'> because the pattern is not a valid regexp: raw bracket is not allowed in regular expression with unicode flag 22 new_tradie.php Unable to check <input pattern='^[a-zA-Z0-9]+[a-zA-Z0-9-\s,():'\.\[\]]*$'> because the pattern is not a valid regexp: character class escape cannot be used in class range in regular expression
  11. INSERT INTO members (trade, business_name, first_name, surname, structure, license description minimum_charge minimum_budget maximum_size maximum_distance unit street suburb state postcode phone mobile email expiry_date) VALUES ('-1', 'Greg\'s Native Landscapes', 'Greg', 'Boyles', '51 824 753 556', 'Sole trader', '', 'Ecological weed control Low maintenance Drought tolerant Irrigation systems Small retaining walls Small tree removal General pruning Bush tucker gardens Small ornamental billabongs Native lawns', '100', '5000', 'Up to 50', '20', '', '56 Derby Drive', 'Epping', 'VIC', '3076', '94013696', '0455328886', 'gregplants@bigpond.com', '2023 10 31') ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Native Landscapes'' at line 1
  12. I am at a total loss as to why this is causing an infinite loop. I just don't understand what it it that strpos is returning when it fails to find the sibstring! How do I make this loop work? function StrReplace($strText, $strFind, $strReplace) { $nI = strpos($strText, $strFind); if ($nI !== FALSE) { $strLeft = substr($strText, 0, $nI); $strRight = substr($strText, $nI + 1); $strText = $strLeft . $strReplace . $strRight; echo "#############<br>"; echo "strText=".$strText."<br>"; echo "strLef =".$strLeft."<br>"; echo "strRight=".$strRight."<br>"; echo "nI=".$nI."<br>"; echo "#############<br>"; } return $strText; } function StrFind($strText, $strFind) { $nPos = strpos($strText, $strFind); if ($nPos === FALSE) $nPos = -1; return $nPos; } function EscapeQuotes($strText) { if (is_string($strText)) { StrFind($strText, "'"); while (StrFind($strText, "'")) { $strText = StrReplace($strText, "'", "#"); echo "@@@@@@@@@@@@@@@@@@@@<br>"; echo $strText."<br>"; echo "@@@@@@@@@@@@@@@@@@@@<br>"; } } } Why is my function StrFind(...) always returning true or greater that 1? How do I stop it from doing that?
  13. The following code is not working as I intuitivel expect it to... $nI = strpos($strText, "'"); $strText = substr_replace($strText, "XXXX", $nI); echo $strText $strText contains "Greg's Native Landscapes" After the call to substr_replace $strText contains GregXXXX I am expecting it to contain "GregXXXXs Native Landscapes" So how the devil is this function working? And how do I obtain the result I am expecting? This function is unbelievably confusing! If I do this instead: $nI = strpos($strText, "'"); $strText = substr_replace($strText, "XXXX", 100); echo $strText I get "Greg's Native LandscapeXXXX". WTF??? Am I really going to have to code my own string library with functions that behave in the ways I am accustomed to!
  14. Not the buttons of course. Rather the bit about requesting the facebook login details etc.
  15. <video width="320" height="250" controls> <source src="https://youtu.be/Ubt7ypQ-qGc" type="video/mp4"> Your browser does not support the video tag. </video> What do you have to do to get past this error?
  16. <iframe class="TryItNowResults" id="TryItNowResults" scrdoc="XXXXX" sandbox="allow-scripts"></iframe> The above iframe element is the window on the right. I can't get it to work with the html property. And nor can I get it to work with javascript!
  17. I have a web site with this structure. If I do this sessionStorage["ShoppigCart"] = "XXXXX" on children.html then that XXXXX is only available on that page. But I want to be able to get at it on emporium.html. Is there any work around or alterantive method to acheive this? Or is it impossible without PHP back end?
  18. And I have tried examining the 'display' property to see of it is equal to 'inline-block' or 'none' but comparing that property to those strings just does not work. So the boolean variables are a work around.
  19. I have these two javascript functions function DoToggleFictionPopupMenu() { var strPopupName = "FictionPopupMenu"; if (document.getElementsByName(strPopupName) !== null) { if (bFictionPopupMenu) { document.getElementsByName(strPopupName)[0].style.display = "none"; } else { document.getElementsByName(strPopupName)[0].style.display = "block"; } bFictionPopupMenu = !bFictionPopupMenu; } else { alert("No such object with name '" + strPopupName + "'!"); } } function DoToggleNonFictionPopupMenu() { var strPopupName = "NonFictionPopupMenu"; if (document.getElementsByName(strPopupName)!== null) { if (bNonFictionPopupMenu) { document.getElementsByName(strPopupName)[0].style.display = "none"; } else { document.getElementsByName(strPopupName)[0].style.display = "inline-block"; } bNonFictionPopupMenu = !bNonFictionPopupMenu; } else { alert("No such object with name '" + strPopupName + "'!"); } } And this menu system <div id="sidebar"> <ul> <li><a href="index.htm">Home</a></li> <li><a href="FAQ/default.html">FAQ</a></li> <li><a href="Emporium/default.html">Emporium</a></li> <li><a href="Requests/default.html">Requests</a></li> <li><a href="Facebook/default.html">Facebook</a></li> <li onclick="DoToggleFictionPopupMenu()"><a href="">Fiction</a></li> <div class="MenuPopup FictionPopup" id="MenuPopup" name="FictionPopupMenu"> <ul> <li class="MenuPopupItem" ><a href="Fiction/Action&Adventure/default.html">Action</a></li> <li class="MenuPopupItem" ><a href="Fiction/Crime/default.html">Crime</a></li> <li class="MenuPopupItem" ><a href="Fiction/Drama/default.html">Drama</a></li> <li class="MenuPopupItem" ><a href="Fiction/Fantasy/default.html">Fantasy</a></li> <li class="MenuPopupItem" ><a href="Fiction/Historical/default.html">Historical</a></li> <li class="MenuPopupItem" ><a href="Fiction/Horror/default.html">Horror</a></li> <li class="MenuPopupItem" ><a href="Fiction/Romance/default.html">Political</a></li> <li class="MenuPopupItem" ><a href="Fiction/Romance/default.html">Romance</a></li> <li class="MenuPopupItem" ><a href="Fiction/ScienceFiction/default.html">Science</a></li> </ul> </div> <li onclick="DoToggleNonFictionPopupMenu()"><a href="">Non-Fiction</a></li> <div class="MenuPopup NonFictionPopup" id="MenuPopup" name="NonFictionPopupMenu"> <ul> <li class="MenuPopupItem" ><a href="NonFiction/Biographies/default.html">Biographies</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Construction/default.html">Construction</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Crafts/default.html">Crafts</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Culture/default.html">Culture</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Engineering/default.html">Engineering</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Food/default.html">Food</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Geography/default.html">Geography</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Handyman/default.html">Handyman</a></li> <li class="MenuPopupItem" ><a href="NonFiction/History/default.html">History</a></li> <li class="MenuPopupItem" ><a href="NonFiction/IT/default.html">IT</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Maths/default.html">Maths</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Nature/default.html">Nature</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Politics/default.html">Politics</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Sports/default.html">Sports</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Travel/default.html">Travel</a></li> <li class="MenuPopupItem" ><a href="NonFiction/Science/default.html">Science</a></li> </ul> </div> </ul> </div> It looks like this to begin with. It is supposed to look like this when you click the 'Fiction' link: Then if you click the 'Fiction' link again that popup menu should close. However when you click it the popup menu appears for half a second and then closes. I can;t figure out what is causing this. master.dwt
  20. <img src="../images/HC-05.jpg" class="image_wrapper" width="400" /> .image_wrapper { margin-left: 5px; margin-right: 5px; border: 0; } How do I get rid of the bloody border???? I have tried everything in the above class. border-thickness border-style border-color I simply cannot change the border from a thin black line to a different color or thickness. Nor remove it. Why? https://drive.google.com/file/d/1CnfmPW6XQDwhmZ7XTfsb1lPWQO8AxXCZ/view?usp=sharing
  21. $strSQL = "SELECT * FROM '".$strTableName."' LIMIT 1"; $Result = $DBConnection->query($strSQL); echo "########".$strSQL."########<br>"; echo "########".$Result->num_rows."########<br>"; How do you do this successfully such that $Result->num_rows does not come back as null. Debug output is thus: @@@@@@@@@@@DoreenColes@@@@@@@@@ ########SELECT * FROM 'DoreenColes' LIMIT 1######## ################ I have successfully connected to my database at this point. The database DOES contain a table named "DoreenColes". And the table definitely contains 1 row of data.
  22. What on earth has an img tag got to to with my canvas? I can't do that for every image that might be dragged and dropped on to my canvas though.
  23. This is the code I am using: function doDisplayHelper(Context, ComponentImage, nPosX, nPosY) { Context.drawImage(ComponentImage, nPosX, nPosY); Context.beginPath(); Context.rect(0, 0, nPosX, nPosY); Context.stroke(); } class CComponentBase { constructor() { this.m_strImageFile = ""; this.m_arrayPins = new CPinArray(); this.m_strDeviceName = ""; this.m_nPosX = 100; this.m_nPosY = 100; } getImageFileName() { return this.m_strImageFile; } setDeviceName(strDeviceName) { this.m_strDeviceName = strDeviceName; } getDeviceName() { return this.m_strDeviceName; } isSelected() { return false; } doSelect() { } doUnselect() { } doDisplay() { var Canvas = getElement("canvas"); var Context = null; var ComponentImage = null; var strImageID = this.getImageFileName(); var nPosX = this.m_nPosX, nPosY = this.m_nPosY; if (Canvas != null) { Context = Canvas.getContext("2d"); if (Context != null) { ComponentImage = new Image(); ComponentImage.src = strImageID; ComponentImage.onload = function() {doDisplayHelper(Context, ComponentImage, nPosX, nPosY);}; } } } } As you can see from the image below there is nothing wrong with the parameters to the doDisplayHelper function because I can draw a rectangle just fine. I just cannot get the image from the .png file to display. Also below is a break point in Firefox developer edition showing the var containing the .png file name. Which definitely exists and is correct. So why does my .png image refuse to display?
  24. How do I make the text 'Fixed Resistors" but up against the image of the resistor? <style> .menu { background-color: teal; height: 64Px; } .menu_item { padding-right: 50Px; display: inline-block; color: white; } .menu_spacer { width: 20Px; display: inline-block; } .menu_item_container { background-color: teal; border-style: none; border-width: 1Px; border-color: black; display: inline-block; vertical-align: top; } .clickable { cursor: pointer; } .popup_menu { background-color: teal; border-style: solid; border-width: 1Px; border-color: #006060; display: none; } .popup_menu_item { background-color: teal; border-style: solid; border-width: 1Px; border-color: #006060; display: block; padding-left: 5Px; padding-right: 5Px; } .popup_menu_item_text { border-style: solid; border-color: black; border-width: 1Px; margin-top: 0Px; margin-bottom: 0Px; } .popup_menu_item_resistor_image { display: block; transform: rotate(90deg); height: 120Px; border-style: solid; border-color: black; border-width: 1Px; margin-left: auto; margin-right: auto; margin-top: 0Px; margin-bottom: 0Px: } .workspace { display: block; background-color: white; margin-top: 28Px; border-style: solid; border-width: 2Px; border-color: black; overflow: scroll; height: 77.5%;` } .canvas { width:100%; height:100%; } </style> </head> <body> <!-- Horizontal Navigation bar --> <nav class="nav-fixed arduino_teal"> <div class="nav-wrapper"> <span class="brand-logo app_title translatable_title">Ardublockly Simulator</span> <!-- Horizontal Navbar links only shown on large resolutions --> <ul id="nav-mobile" class="right hide-on-med-and-down"> <li><a href="#" id="button_start"><span class="translatable_open" onclick="doStart()">Start</span></a></li> <li><a href="#" id="button_stop"><span class="translatable_save" onclick="doStop()">Stop</span></a></li> </ul> </div> <div id="menu" class="menu"> <div id="spacer" class="menu_spacer"></div> <div id="resistors_menu_container" class="menu_item_container"> <div id="resistors_menu_item" class="clickable menu_item" onclick="doDisplayResistorsPopup()">RESISTORS</div> <div id="resistors_popup" class="popup_menu clickable"> <div class="popup_menu_item"> <span class="popup_menu_item_text">Fixed Resistor</span> <img class="popup_menu_item_resistor_image" src="img\Components\Resistors\R10k.png"> </div> <div class="popup_menu_item"> <span class="popup_menu_item_text">Potentiometer</span> </div> <div class="popup_menu_item">&nbsp;LDR</div> <div class="popup_menu_item">&nbsp;LED</div> <div class="popup_menu_item">&nbsp;RGB LED</div> </div> </div> <div id="leds_menu_container" class="menu_item_container"> <div id="leds_menu_item" class="clickable menu_item" onclick="doDisplayLEDPopup()">LEDs</div> <div id="leds_popup" class="popup_menu"> <div class="popup_menu_item">&nbsp;LED</div> <div class="popup_menu_item">&nbsp;RGB LED</div> </div> </div> <div id="discrete_components_menu_container" class="menu_item_container"> <div id="discrete_components_menu_item" class="clickable menu_item" onclick="doDisplayDiscreteComponentsPopup()">DISCRETE COMPONENTS</div> <div id="discrete_components_popup" class="popup_menu"> <div class="popup_menu_item">&nbsp;NPN Transistor</div> <div class="popup_menu_item">&nbsp;Diode</div> <div class="popup_menu_item">&nbsp;Capacitor</div> </div> </div> <div id="switches_menu_container" class="menu_item_container"> <div id="switches_menu_item" class="clickable menu_item" onclick="doDisplaySwitchesPopup()">SWITCHES</div> <div id="switches_popup" class="popup_menu"> <div class="popup_menu_item">&nbsp;Switch</div> <div class="popup_menu_item">&nbsp;Push Button</div> </div> </div> <div id="motors_menu_container" class="menu_item_container"> <div id="motors_menu_item" class="clickable menu_item" onclick="doDisplayMotorsPopup()">MOTORS</div> <div id="motors_popup" class="popup_menu"> <div class="popup_menu_item">&nbsp;DC Motor</div> <div class="popup_menu_item">&nbsp;DC Gear Motor</div> <div class="popup_menu_item">&nbsp;Servo</div> <div class="popup_menu_item">&nbsp;Vibration Motor</div> </div> </div> <div id="sensors_module_menu_container" class="menu_item_container"> <span id="sensor_modules_menu_item" class="clickable menu_item" onclick="doDisplaySensorModulesPopup()">SENSOR MODULES</span> <div id="sensor_modules_popup" class="popup_menu"> <div class="popup_menu_item">&nbsp;Ultrasonic Sensor</div> <div class="popup_menu_item">&nbsp;Motion Sensor</div> <div class="popup_menu_item">&nbsp;Temperature Sensor</div> <div class="popup_menu_item">&nbsp;Piezo Speaker</div> </div> </div> <div id="power_supply_menu_container" class="menu_item_container"> <span id="power_supply_menu_item" class="clickable menu_item" onclick="doDisplayPowerSupplyPopup()">POWER SOURCES</span> <div id="power_supply_popup" class="popup_menu"> <div class="popup_menu_item">&nbsp;12V Battery</div> <div class="popup_menu_item">&nbsp;6V Battery</div> <div class="popup_menu_item">&nbsp;3V Battery</div> </div> </div> </div> </nav>
  25. 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); ?>
×
×
  • Create New...