Jump to content

NotSunfighter

Members
  • Content Count

    37
  • Joined

  • Last visited

  • Days Won

    1

NotSunfighter last won the day on April 13

NotSunfighter had the most liked content!

Community Reputation

4 Neutral

About NotSunfighter

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location
    Urbandale, Ia
  1. Why are you pulling everything from the db with the * when all you want is the rank? In your echo you are putting a double quote inside a double quote. => You have a rank of " . $user['rank'] . "
  2. Stop using tables. Use divs for the cells. Put them in a container and flex that.
  3. Not going to code this, but off the top of my head I would use Flex-box and not a table. Set it up to display as you have it above (horizon.) . Then set the flex order by row to instantly create a vertical table.
  4. Was expecting the 6 blocks to be clickable.
  5. Got your first foreach to work with: foreach ($xmlA->PRODUCT as $proda) { echo $proda->PRODUCT_NUMBER; echo $proda->PRODUCT_NAME; echo $proda->PRODUCT_PRINT_ID; }
  6. I believe I would convert the mm entrees to meters first then get the square meters. $dimension1 = 850/1000; $dimension2 = 1447/1000; $square_metres = $dimension1 * $dimension2; The results would be 1.22995 square meters. You can use number_format() if you need to limit the number of decimal places.
  7. This is an example of LABEL with INPUT. Works down to 175px width. At this point a keyboard for input is useless. The placeholder attribute was to be a 'hint'. You give a book a title like The Long Kiss Goodnight" and a hint like P. Eye story <!DOCTYPE html> <html lang="en"> <head> <style> #find-search { background: #3a658e; padding-left: 10px; border-radius: 3px; cursor: pointer; margin-left: 5px; color:white; } #find-search:hover { background-color: #399edc } #quickfind{ font-size: smaller; } </style> </head> <body> <form action="/quickfind" id="quickfind" method="post" name="quickfind"> <label for="find-search">Quick Search</label> <input type="text" id="find-search" placeholder="Keywords"> </form> </body> </html> I'd rely on placeholders in situations like this: <!DOCTYPE html> <html lang="en"> <head> <style> #find-search { background: #3a658e; padding-left: 10px; border-radius: 3px; cursor: pointer; color:white; } #find-search:hover { background-color: #399edc } </style> </head> <body> <form action="/quickfind" id="quickfind" method="post" name="quickfind"> <label>Enter your name</label><br> <input type="text" id="find-search" placeholder="First name"><br> <input type="text" id="find-search" placeholder="Last Name"> </form> </body> </html>
  8. Horrible coding practice to use a placeholder in place of a <label>.
  9. You have a link that the user pushes to see the number of new messages; so it most probably is done through AJAX. A listener on that link would change anything. What I think your looking for is PUSH notifications which are way above your pay grade. You could simulate push notifications with a time loop in JS to send the request every once in a while.
  10. This is my take on your question. Have a sign in page. This will give the user an identification. On that page list all things that are to be worked on. Identify which items are in use and which are open. Maybe back ground color etc.. The user selects what he/she wants to work on first - that assigns this page to her. Then have user pick which he wants to be notified when available. Add him to the list. You can work thing out from there.
  11. Jayfromsandiego give my script a try please and post here for a little while. Let me know what you think of the script - we can fix any problems that you have with it. I am new here myself - Most posts I see here are to help people with problems. ginerjm maybe a little ruff with his answers, but he does give good advice. I think he just didn't look at what you posted very close, but he did look. When I did this my eye sight was not up to it's potential Don't go away mad - stay and get the help you need.- Just had the lids operated on, so I could not see the pictures you loaded and just went with the code.
  12. The code you found looks like a training thing about Jquery and has little to do with the actual problem and more about how Jquery does really nice stuff. I wrote everything from scratch, almost. Lots of tweaking needed. Fast explanation about the JS: When page loads we set up a new XMLHttpRequest() so we can use AJAX to get to the PHP file. The rest is a function called by the 'submit' button. I use a loop to query all the input tags and count the number of radio buttons selected. This could have been a little more precise in the tag called. - 6 questions so I need 6 checked buttons. I use a IF/ELSE section for that. You will need to handle the Not Equal section. myString will be the values of the selections separated by a comma. This string is sent to my 'test5.php' file by the rest of the code - right after I remove the comma at the end of the string. In the PHP file I make a string of correct answers $mine. I then convert that string and the string I received via the $_GET[] into arrays. Followed by a for loop to compare each answer to the master array and send the outcome back to the main file, where it is posted. The main file has been moved and worked on in various browsers and text editors - I think it's good code, but at this point no guarantees cause I'm done working on it today. Main File HTML <!DOCTYPE html> <html lang="en"> <head> <title>Website - Voting Poll (Javascript)</title> <link href="https://fonts.googleapis.com/css?family=Josefin+Sans" rel="stylesheet"> <style> body{ font-family: 'Josefin Sans', sans-serif; } h1 { text-align: center; } #container { width:50%; margin: 150px auto; padding: 50px 30px; background-color: #3f51b5; border-radius:3px; color: #fff; box-shadow: 0 0 10px 0 #999; } ol { list-style-type: none; padding: 0; margin: 0; width: 500px; } ol li { background: #223394; width: 200px; margin: 10px; padding: 5px; } input, label{ cursor: pointer; } input[value="no"]{ margin-left: 45px; } button{ width : 70px; margin-left: 10px; } </style> </head> <body> <div id="container"> <h1>Voting Poll >> In Less Than A Minute</h1> <div id="proof"></div> <ol> <li>This is question #1<br> <label for="yes1"><input type="radio" name="q1" value="yes" id="yes1">Yes</label> <label for="no1"><input type="radio" name="q1" value="no" id="no1">No</label> </li> <li>This is question #2<br> <label for="yes2"><input type="radio" name="q2" value="yes" id="yes2">Yes</label> <label for="no2"><input type="radio" name="q2" value="no" id="no2"> No</label> </li> <li>This is question #3<br> <label for="yes3"><input type="radio" name="q3" value="yes" id="yes3">Yes</label> <label for="no3"><input type="radio" name="q3" value="no" id="no3"> No</label> </li> <li>This is question #4<br> <label for="yes4"><input type="radio" name="q4" value="yes" id="yes4">Yes</label> <label for="no4"><input type="radio" name="q4" value="no" id="no4"> No</label> </li> <li>This is question #5<br> <label for="yes5"><input type="radio" name="q5" value="yes" id="yes5">Yes</label> <label for="no5"><input type="radio" name="q5" value="no" id="no5"> No</label> </li> <li>This is question #6<br> <label for="yes6"><input type="radio" name="q6" value="yes" id="yes6">Yes</label> <label for="no6"><input type="radio" name="q6" value="no" id="no6"> No</label> </li> </ol> <button type="button" onclick="sendTest()">Submit </div> <script> var xhttp = new XMLHttpRequest(); function sendTest(){ var myObj = {"q1":"maybe", "q2":"maybe", "q3":"maybe", "q4":"maybe", "q5":"maybe", "q6":"maybe"}; var counter = 0; x = document.querySelectorAll("input"); for (i = 0; i < x.length; i++) { if(x[i].checked){ counter++; } } if(counter != 6) { document.getElementById("proof").innerHTML="ERROR"; return; }else{ for (i = 0; i < x.length; i++){ if(x[i].checked){ myString += x[i].value + ","; } } var myString = JSON.stringify(myObj); } xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("proof").innerHTML = this.responseText; } } xhttp.open("GET", "test5.php?myString", true); xhttp.send(); } </script> </body> </html> The file it calls - test5.php <?php $str= $_GET["q"]; $mine = 'yes,no,yes,no,yes,no'; $corr = 0; $wron = 0; $arr = explode(',', $str); $arry = explode(',', $mine); for ($i=0; $i<6; $i++){ if($arr[$i] == $arry[$i]){ $corr++; echo $corr.' correct<br>'; }else{ $wron = $wron + 1; echo $wron.' wrong<br>'; } } echo 'You have '.$corr.' correct and '.$wron.' wrong.'; ?> I really hope this is a giant help. If not we're always here, sort of.
  13. If you want raw JS: place an id on your <li> Lets say id='myJS' and: document.getElementById("myJS").addEventListener("click", function(){ Put your code here between the curly brackets });
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.