Jump to content

lonewolf217

Members
  • Posts

    642
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lonewolf217's Achievements

Member

Member (2/5)

0

Reputation

  1. i code in notepad++ not dreamweaver so unsure. does dreamweaver even support jquery ? post the whole section of code here, maybe there is another syntax error somewhere
  2. that is why javascript validation is a "nice to do" feature but you must always revalidate in the backend to make sure the data is correct.
  3. javascript is the wrong way to do this since they can just disable javascript in the browser. use php or even better would be filesystem/webserver level security to restrict access
  4. because you already retrieved the first record here <?php $results = mysql_query($query) or die("Query failed ($query) - " . mysql_error()); $row_a = mysql_fetch_assoc($results); <----------------------------- ?>
  5. yea sorry you need to include the jquery source files and then wrap this into the script headers. you can find the details at jquery.com
  6. You are using the same object for the loop iteration as you are the counter so your $data object is reset each time during the loop. Use a different object for your counter and you should be fine, and make sure you initialize it to zero.
  7. with a class you no longer need the onclick, you would just have jquery something like this $(document).ready({ $(".dropdown").change(function() { var total = 0; $(".dropdown").each(s,function() { total += s.val(); }); $("#total").innerHTML("The Total is " + total); }); <body> <span id="total"></span> </body> });
  8. if i understand correctly you just need to sum the vals from multiple dropdowns, so assign an ID to each dropdown then you can do something like this (excuse little syntax errors) <select name='drop1' id='drop1' onChange='sumSelect()';> </select> <select name='drop2' id='drop2' onChange='sumSelect()';> </select <select name='drop3' id='drop3' onChange='sumSelect()';> </select> <span id="total"></span> <script type="text/javascript"> function sumSelect() { var total = document.getElementById("drop1").val() + document.getElementById("drop2").val() + document.getElementById("drop3").val(); document.getElementById("total").innerHTML(total); } </script> of course you can optimize it by looping through all of your select statements depending on your naming convention, something like jquery could really speed it up if they have all the same class for example.
  9. you can easily modify the math to show whatever you want
  10. check all of your braces, i think you are missing a couple of closes for For and Ifs in the "case 'restorelocalnow':" section
  11. unfortunately wmi calls seem to return variant objects which are a pain in the ass to work with. so i guess there is nothing i can do about it.
  12. the problem is that obviously it was not expecting it, so you would either have to post the entire switch statement or look for syntax errors within the statement. perhaps you didn't close a brace or something so it wasn't expecting the next case statement yet.
  13. since we dont know where your inputs are coming from, simplest way to check is to do this <?php echo "INSERT INTO users (name, group, sex, grouprank) VALUES ('$name', '$group', '$sex', '$grouprank')"; ?> throw the query into SQL manually to see what the error is. One possibility is that SQL doesn't like variable names. you can try one of these two options to see if it helps (I dont know the reasoning behind it, but i read it somewhere once before ) <?php $insert = mysql_query("INSERT INTO users (name, group, sex, grouprank) VALUES ('{$name}', '{$group}', '{$sex}', '{$grouprank}')"); $insert = mysql_query("INSERT INTO users (name, group, sex, grouprank) VALUES ('".$name."', '".$group."', '".$sex."', '".$grouprank."')"); ?>
  14. Not one of the ones i saw before but still an interesting read. I did try to use this <?php $x = &$resultDisk; ForEach($x as $itemDisk) { ?> but it didn't seem to improve the speed at all. I will give your article a closer looksee to make sure i didn't miss anything.
×
×
  • 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.