Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. generating menus problems

    this sound way better than what i just did, now i just have to adjust my database to make this work, thank a lot dsonesuk
  3. generating menus problems

    The way i did it was to have all menus in single database table, there would be auto increment id for each and every menu, also there would be another column to hold parent menu id, which could hold many identical id ref to the single auto incremental id that refers to parent, if a menu had no sub-menus it would be given a value of zero. The loop would go through all menu id, if parent link equals 0 display single parent menu, move to next, if other than zero stop and with nested loop gather all records (submenus) whose parent menu id's equals current parent menu unique id from outer loop.
  4. generating menus problems

    so i been messing around with php to find a way to generate menus using php *im bored, so yeah better do something* anyway i decided to do it this way function menu() { include "config.php"; $mainMenu = mysqli_query($con, "SELECT * FROM `main-menu`") or die('Error: ' . mysqli_error($con)); if($mainMenu){ ?> <ul> <?php while($mainRow = mysqli_fetch_assoc($mainMenu)){ $menuId = $mainRow['id']; $commonName = $mainRow['actualName']; $menuName = $mainRow['name']; $menuTags = '<li><a href="' . $menuName . '">' . $commonName; echo $menuTags; } // check if there's any submenus $subMenu = mysqli_query($con, "SELECT * FROM `sub-menu` WHERE `sub-id`=$menuId") or die('Error: ' . mysqli_error($con)); if($subMenu){ while($subRow = mysqli_fetch_assoc($subMenu)){ $subId = $subRow['sub-id']; $subName = $subRow['sub-name']; $subConame = $subRow['actualNames']; $subMain = $subRow['main-menu-id']; $actualMenu = '<ul>'; $actualMenu .= '<li><a href="' . $subName . '">' . $subConame . '</li>'; $actualMenu .= '</ul></li>'; echo $actualMenu; } } } ?> </ul> <?php } ?> i was wonder if there is another way of doing this, because im only getting one of the sub menu instead of both of them so currently the menu looks like this Home Services Service 1 it suppose to look like this instead Home Services Service 1 Service 2 any idea of what im doing wrong? as always your response is appreciated greatly
  5. Responsive Column Height with Browser Window Resize

    It should adjust to device width automatically, you could use JavaScript onresize() event to trigger a reload, but this shouldn't really be needed.
  6. how to detect which page im on

    thanks
  7. How do I invoke multiple functions automatically

    You can't have two identical functions with same name, you can send some sort of identifier, for different table, then process on the identifier sent in if/else condition OR of course change one of the function names and refer to that function depending the table you want to produce.
  8. I have noticed that using the @media screen tag behaves differently with the direction in which the window or viewport is resized. Intuitively, one would expect that widening the window or viewport would undo whatever occurred when the window was narrowed. This is not, how it works, however. Is there a general rule of thumb to implement directionally symmetric changes? Roddy
  9. What happens when you increase the width of your window? Is your viewport large enough to see both tables side-by-side? I ask this, because this is how you have them positioned with your CSS. .scColl {position:absolute; top:0; left:0; width:1050px; height:2000px; border:2px solid red;} .scTot {position:absolute; top:0; right:0; width:250px; height:2000px; border:2px solid red;} Both DIV elements are position top:0. One is positioned left:0 and the other right:0. This should produce a row, not column effect. Yes, XMLHttpRequest is a reserved word, but the variable to which you assign the returned object is not. It will not disturb your code to name the returned object differently. In fact, it will increase your ability to manipulate what is returned. Find the icon in the bottom right corner of any entry and pass your cursor over it. it is there where you will find the trophy. Roddy
  10. how to detect which page im on

    Check out some of the $_SERVER vars: http://php.net/manual/en/reserved.variables.server.php
  11. How do I invoke multiple functions automatically

    Hey iwato, thanx for your quick response - I only had time to have a sandwich. I thought that 'XMLHttpRequest' was a reserved word - as a constructor or like. I will give it a whirl and let you know. How do I award a trophy. I asked another responder how to mark a post as answered and he said people just change the title of their request to 'solved'. Can you give me a heads up on that? thanks, Gil I have changed the variable names to separate the 2 functions. Still the same - I see what you were saying, but I figured one function would be done before the other took effect. Here's what I've got now. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Service Club Collections</title> <style> .wholePage { position: relative; width: 1350px; height: 2000px; border: 2px solid red; margin:auto;} .scColl { position:absolute; top:0; left:0; width:1050px; height:2000px; border:2px solid red;} .scTot { position: absolute; top: 0; right: 0; width: 250px; height: 2000px; border: 2px solid red;} #collections { position:absolute; top:0; left:0;} #totals { position:absolute; top:0; right:0;} table, th, td { border: 1px solid red; border-collapse: collapse;} th, td { padding: 7px 10px;} th { font-size:14px; color: firebrick;} td { font-size:12px; color: darkolivegreen; text-align: center;} </style> </head> <body> <a href="ringerinfo.html" type="button" style="margin:auto">Return</a> <div class="wholePage"> <div class="scColl"> <table id="collections"></table> </div> <div class="scTot"> <table id="totals"></table> </div> </div> <script> (function loadXMLCollDoc() { var xmlhttpcoll = new XMLHttpRequest(); xmlhttpcoll.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xmlhttpcoll.open("GET", "datafiles/servClubColl.xml", true); xmlhttpcoll.send(); })(); function myFunction(xmlcoll) { var i; var xmlCollDoc = xmlcoll.responseXML; var table ="<tr><th>Service Club</th><th>Ring Date</th><th>Location</th><th>Start Time</th><th>End Time</th><th>Total Bills</th><th>Total Coins</th><th>Total Checks</th><th>Total Kettle</th></tr>"; var x = xmlCollDoc.getElementsByTagName("scCollections"); for (i = 0; i <x.length; i++) { table += "<tr><td>" + x[i].getElementsByTagName("RingerName")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("RingDate")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Location")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("SchedStart")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("SchedEnd")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Bills")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Coins")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Checks")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("AmountCollected")[0].childNodes[0].nodeValue + "</td></tr>"; } document.getElementById("collections").innerHTML = table; } (function loadXMLTotDoc() { var xmlhttptot = new XMLHttpRequest(); xmlhttptot.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xmlhttptot.open("GET", "datafiles/scTotals.xml", true); xmlhttptot.send(); })(); function myFunction(xmltot) { var i; var xmlTotDoc = xmltot.responseXML; var table = "<tr><th>Service Club</th><th>Seasonal Total</th></tr>"; var x = xmlTotDoc.getElementsByTagName("Totals"); for (i = 0; i < x.length; i++) { table += "<tr><td>" + x[i].getElementsByTagName("ServClub")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("TotalAmount")[0].childNodes[0].nodeValue + "</td></tr>"; } document.getElementById("totals").innerHTML = table; } </script> </body> </html>
  12. How can I put blur on the image?

    Sure I will do that.
  13. How can I put blur on the image?

    Note: MS Internet Explorer and Edge browsers are 5 years behind other better browsers, you might want to consider alternative with svg instead, I had the same problem a few months ago, though i can't remember where I got solution from. try google: alternative to css3 blur Internet explorer
  14. What would happen if you were to use different variable names for your XMLHttpRequest() -- say, xmlhttp_1 and xmlhttp_2? You appear to be cancelling the content of the first object when you replace it with the content of the second. Roddy p.s. If my suggestion works award me with a trophy.
  15. How can I put blur on the image?

    Thank you much. This is exactly what I needed.
  16. Hi, I've made an html page that invokes a function automatically ( using the parentheses b/4 & after ) to make a table from an XML file. It worked great with a little help from you guys. I then made another one to read a different XML file and that worked great. I want to put both tables on the same page so I made a couple of 'divs' and positioned each in a column formation. That part seems to work well, but I am calling the 2 functions to make the tables consecutively and it doesn't work as I wanted. When I open this file in a browser, as it is here, I get only the second table in the second column correctly; and if I comment out the second table, I get only the first table in the first column correctly. I've included the code below; I hope someone can tell me how to do this. Also just a sample of the 2 XMLs I'm trying to display. Do I need a wrapper function with the others invoked from it, or something like that. Thanks <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Service Club Collections</title> <style> .wholePage { position: relative; width: 1350px; height: 2000px; border: 2px solid red; margin:auto;} .scColl { position:absolute; top:0; left:0; width:1050px; height:2000px; border:2px solid red;} .scTot { position: absolute; top: 0; right: 0; width: 250px; height: 2000px; border: 2px solid red;} #collections { position:absolute; top:0; left:0;} #totals { position:absolute; top:0; right:0;} table, th, td { border: 1px solid red; border-collapse: collapse;} th, td { padding: 7px 10px;} th { font-size:14px; color: firebrick;} td { font-size:12px; color: darkolivegreen; text-align: center;} </style> </head> <body> <a href="ringerinfo.html" type="button">Return</a> <div class="wholePage"> <div class="scColl"> <table id="collections"></table> </div> <div class="scTot"> <table id="totals"></table> </div> </div> <script> (function loadXMLCollDoc() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xmlhttp.open("GET", "datafiles/servClubColl.xml", true); xmlhttp.send(); })(); function myFunction(xmlcoll) { var i; var xmlDoc = xmlcoll.responseXML; var table ="<tr><th>Service Club</th><th>Ring Date</th><th>Location</th><th>Start Time</th><th>End Time</th><th>Total Bills</th><th>Total Coins</th><th>Total Checks</th><th>Total Kettle</th></tr>"; var x = xmlDoc.getElementsByTagName("scCollections"); for (i = 0; i <x.length; i++) { table += "<tr><td>" + x[i].getElementsByTagName("RingerName")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("RingDate")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Location")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("SchedStart")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("SchedEnd")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Bills")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Coins")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("Checks")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("AmountCollected")[0].childNodes[0].nodeValue + "</td></tr>"; } document.getElementById("collections").innerHTML = table; } (function loadXMLTotDoc() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xmlhttp.open("GET", "datafiles/scTotals.xml", true); xmlhttp.send(); })(); function myFunction(xmltot) { var i; var xmlDoc = xmltot.responseXML; var table = "<tr><th>Service Club</th><th>Seasonal Total</th></tr>"; var x = xmlDoc.getElementsByTagName("Totals"); for (i = 0; i < x.length; i++) { table += "<tr><td>" + x[i].getElementsByTagName("ServClub")[0].childNodes[0].nodeValue + "</td><td>" + x[i].getElementsByTagName("TotalAmount")[0].childNodes[0].nodeValue + "</td></tr>"; } document.getElementById("totals").innerHTML = table; } </script> </body> </html> Here is just a sample of the XML data files *********************************** <?xml version='1.0' encoding='utf-8'?> <dataroot> <scCollections> <RingerName>1st National bank scotia</RingerName> <RingDate>Dec 12 - Mon</RingDate> <Location>Price Chopper Niskayuna Left Door</Location> <SchedStart>9:00 am</SchedStart> <SchedEnd>9:00 pm</SchedEnd> <Bills>$ 243</Bills> <Coins>$ 27</Coins> <Checks>$ 00</Checks> <AmountCollected>$ 270</AmountCollected> </scCollections> <scCollections> <RingerName>Advisory Board</RingerName> <RingDate>Dec 9 - Fri</RingDate> <Location>Co-Op Nott St Niskayuna</Location> <SchedStart>9:00 am</SchedStart> <SchedEnd>1:00 pm</SchedEnd> <Bills>$ 131</Bills> <Coins>$ 15</Coins> <Checks>$ 00</Checks> <AmountCollected>$ 146</AmountCollected> </scCollections> <scCollections> <RingerName>Beukendall Eastern Star</RingerName> <RingDate>Dec 7 - Wed</RingDate> <Location>Price Chopper Glenville Main Dr</Location> <SchedStart>9:00 am</SchedStart> <SchedEnd>7:00 pm</SchedEnd> <Bills>$ 283</Bills> <Coins>$ 64</Coins> <Checks>$ 100</Checks> <AmountCollected>$ 447</AmountCollected> </scCollections> <scCollections> <RingerName>Beukendall Eastern Star</RingerName> <RingDate>Dec 8 - Thu</RingDate> <Location>Price Chopper Glenville Main Dr</Location> <SchedStart>9:00 am</SchedStart> <SchedEnd>7:00 pm</SchedEnd> <Bills>$ 415</Bills> <Coins>$ 38</Coins> <Checks>$ 00</Checks> <AmountCollected>$ 453</AmountCollected> </scCollections> </dataroot> AND ********************************* <?xml version='1.0' encoding='utf-8'?> <dataroot> <Totals> <ServClub>1st National bank scotia</ServClub> <TotalAmount>$ 270</TotalAmount> </Totals> <Totals> <ServClub>Advisory Board</ServClub> <TotalAmount>$ 146</TotalAmount> </Totals> <Totals> <ServClub>Beukendall Eastern Star</ServClub> <TotalAmount>$ 900</TotalAmount> </Totals> <Totals> <ServClub>Corps Band</ServClub> <TotalAmount>$ 190</TotalAmount> </Totals> <Totals> <ServClub>General Electric Volunteers</ServClub> <TotalAmount>$ 2505</TotalAmount> </Totals> </dataroot>
  17. How can I put blur on the image?

    You have not use content: property to create a sort of textual element which you can style as you would any other element, such as assigning a background-image to it. https://www.w3schools.com/code/tryit.asp?filename=FKQ6I0XUJ7BR
  18. How can I put blur on the image?

    I read your answer multiple times but I could not understand completely. Below is what I tried. <div class="test"> <p> my paragraph </p> </div> .test { background-image: url(/sites/default/files/Fortune.png); background-repeat: no-repeat; background-size: cover; background-position: 0 100%; padding: 100px 15% 100px 15%; } .test::after { text-align: center; color: #221301; background-color: red; filter: blur(3px); opacity: .5; } I see the background image and then the paragraph on top. But I expected the background image to have red color with blur and opacity and I did not see it. Please advise.
  19. w3-btn and what am I doing wrong?

    What i would do is apply a class to parent container, use that class name along with w-3 class colour you wish to target, to give it higher precedence, then change to whatever colour you wish, without messing around with original w-3 css styling and duplicating everything. you could use w3-color-overide01 on parent then .w3-color-overide01 .w3-aqua {background-color: lime; }
  20. how to detect which page im on

    hey so i had this topic up here before but cant find it. does anyone know how i can go about detecting the webpage im on using php?
  21. w3-btn and what am I doing wrong?

    Ok, so after much experimenting I have gotten it to work with this code, not exactly what I was hoping for, but it works - <li>J: Where are you ______?<button class="w3-container w3-btn BtnShowAnswerPink" onclick="myFunction('l')">Answer</button> <div class="w3-container w3-hide BtnAnswerPink" id="l" style="width:65%;">Where are you from?</div> </li> So, what would be really nice if including whatever makes up "w3-container" and "w3-btn" into the BtnShowAnswerPink and "w3-container" and "w3-hide" into BtnAnswerPink. I have tried by copying everything related to those and pasting into the code but it simply doesn't work, as if something is still missing. The buttons don't open. So at this point, I'm going with the above solution. If anyone knows how to integrate the other bits please post the info here.
  22. If you look at the site I am currently working on ( https://www.bronies.be/ ) You will most likely notice that the footer image on the left does have some issues. This is what is not working: 1. The footer should be the end, while now the body is still showing, due to the absolute image. overflow-y hidden did not work here. 2. The bottom CSS code seems to be unable to understand -20%. How do i say that the absolute image should be 20% lowwer. While I am on the subject: When i have an absolue element inside a relative element, how do i make the height of he relative element to fit in height to the absolue height. Maybe this example will make my question clear: https://sunamena.be/forw3/index.php Thanks in advance for the kind replies =D
  23. w3-btn and what am I doing wrong?

    On a webpage I'm building the client likes his buttons to be formated with the following - <button class="w3-btn w3-left-align w3-aqua w3-border w3-border-indigo w3-round-xxlarge w3-small" onclick="myFunction('a')">Answer</button> <div id="a" class="w3-container w3-hide w3-left-align w3-aqua w3-border w3-border-indigo w3-round-xxlarge w3-small" style="width:65%;">orange</div> Problem is he wants different colors on different pages, and many of them. So in the future changing the colors will be a major drag. Using all those selectors like that defeats the purpose of the css, right? So I am working on making a selector that contains all the details of the w3-btn w3-left-align w3-aqua w3-border etc etc. I have searched the w3-css style sheet version 3 for all relevant attibutes and have come up with this - .BtnShowAnswerPink { border:none; display:block; outline:0; padding:6px 16px; vertical-align:middle; overflow:hidden; text-decoration:none!important; text-align:center; cursor:pointer; white-space:nowrap; -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; box-shadow:none; float:left; width:100%; -webkit-transition:background-color .25s,color .15s,box-shadow .25s,opacity 0.25s,filter 0.25s,border 0.15s; transition:background-color .25s,color .15s,box-shadow .15s,opacity .25s,filter .25s,border .15s; color:#000!important; background-color:#ff9999!important; border:1px solid #ccc!important; border-color:#ff3333!important; border-radius:32px; font-size:12px!important; } .BtnHideAnswerPink { padding:0.01em 16px; display:none!important; color:#000!important; background-color:#ff9999!important; border:1px solid #ccc!important; border-color:#f44336!important; border-radius:32px; font-size:12px!important; } Problem is it doesn't actually work. The button does not expand to show the text. After much more experimenting I have found that the first part, .BtnShowAnswerPink, is ok, the problem is in the second section. What is happening is the button does not expand. I have verified the javascript, and it is fine. So, at this time, this is what I have working - <li>D: _____, I'm Donna.<button onclick="myFunction('a')" class="BtnShowAnswerPink">Answer</button> <div id="a" class="w3-container w3-hide w3-left-align w3-pink w3-border w3-border-red w3-round-xxlarge w3-small" style="width:65%;"> Hi (Hello), I'm Donna. </div> </li> The javascript also comes from this site, here it is: <script> function myFunction(id) { var x = document.getElementById(id); if (x.className.indexOf("w3-show") == -1) { x.className += " w3-show"; } else { x.className = x.className.replace(" w3-show", ""); } } </script> What am I missing from the second part, .BtnHideAnswerPink? I can't provide a link to the site as it is not published, yet. Thanks.
  24. Little advice about login page

    Hi. I wanna create a signup/login thingy. You can see it at sweiss.co.il/sfn/ . So i have the index.html with 2 forms 1 for login and 1 for signup, each has his own action going to login.php and signup.php , but i want them both leading to something like main.php only problem i dont know how to figure if the user clicked on the submit of the new user or the sumbit of the login as existent user (which obviously make main.php behave differently). Whats the best way to make it happen? Thanx very much in advance
  25. XML not working - can't see what's wrong

    When inserting coding select '<>‘ above. There has never been a marked as solved option, people sometimes add '[solved]' to original title.
  26. XML not working - can't see what's wrong

    Thank you so much for your reply. Sorry it took so long to get back to you - it seems I don't get an email when someone replies. Both of your answers worked out perfectly and I can now do the XML with no problems. Just for future reference, I don't know why the file I copied came out like triple spaced. I copied and pasted - is there a better way? And I don't see where to mark this question as answered. In other forums they usually have a button right here that says 'answered'. Thanx again dsonesuk!
  1. Load more activity
×