Jump to content

gregaryb

Members
  • Posts

    46
  • Joined

  • Last visited

Recent Profile Visitors

722 profile views

gregaryb's Achievements

Newbie

Newbie (1/7)

0

Reputation

  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?
×
×
  • Create New...