Jump to content

Destramic

Members
  • Posts

    968
  • Joined

  • Last visited

Everything posted by Destramic

  1. im unable to get this to work with check boxes [code] function toggle_checkboxes(the_form) { for (var i = 0; i <the_form.length; i++) { if (the_form[i].type == 'checkbox') { the_form[i].checked = checkbox_status; } } if (checkbox_status) { checkbox_status = false; } else { checkbox_status = true; } } <span onclick="toggle_checkboxes(this.form);">Check/Uncheck all</span> [/code]
  2. the code below will work for strings and arrays...but doesnt seem to work for $_POST and $_GET etc...anyone figure out why ? [code] <?php function strip_slashes($value) { // Check if Magic Quotes is enabled if (get_magic_quotes_gpc()) { // Check if string exists if (is_string($value)) { return stripslashes($value); } elseif (is_array($value)) { return array_map('strip_slashes', $value); } } } ?> [/code]
  3. yes...could get it to work
  4. ok no worries ive got it to work now...can anyone help me on how i would do a onclick with just text alone?
  5. i think stripslashes should be done before data is added to the database...now we've got the function to work....how do i get it work on input boxes before going to mysql database... as ive said if i type: This\'s an string\'s on submit in the input field it will show: This\\\'s an string\\\'s
  6. im not sure on what you want to do but to use inside a function do something like this [code] <?php function vars(); {     echo $_GET['var'];     echo $_GET['id']; } // display function echo vars(); ?> [/code]
  7. <?php echo $id; ?> using php at the opening tag is good practice...sorry
  8. well then i would do something like this: <?php switch($_GET['id']) {     case "1":     require_once "folder/file.php";     break;     case "2":     require_once "folder/file.php";     break;     case "3":     require_once "folder/file.php";     break; } ?>
  9. do this: index.php?id=01 [code] <?php switch($_GET['id']) {     case "01":     require_once "file1.php";     break;     case "02":     require_once "file2.php";     break; } ?> [/code]
  10. index.php?id=0001&var=22 [code] <?php $id  = $_GET['id']; $var = $_GET['var']; echo "id:" . $id; echo "var:" . $var; ?> [/code]
  11. check_value gets defined here: if (checked_value) { checked_value = false; } else { checked_value = true; }
  12. there should be a way of changing the css class of a select box easily?
  13. ok...well i though the best way to strip slashes is before it is added to the database.... but you think i should do it when i am querying the results? thanks destramic
  14. thank you so much that works fine...only problem i have now is when i use it on my form when i post this: This\'s an string\'s and then submit it will then do something like this in the input box: This\\\'s an string\\\'s is there a simple way of making this work? see for yourself: http://82.47.18.28/error.php?error=404
  15. anyone know how i can stripslashes on array?
  16. i have a problem...i want to9 be able to have my select box displayed and when the user goes through the options the background colour will change...ive made it possible with input and textarea but for some reason or other i cannot get it to work on select box..can anyone help please? [code] <select id="error_type" name="error_type" onmouseover="this.className='mouse_over';"  onmouseout="this.className='this.class';"> <optgroup label="Select Error Type"> <option value=""></option> <option value="Broken Link" <?php echo $broken_link; ?>>Broken Link</option> <option value="Spelling Mistake" <?php echo $spelling_mistake; ?>>Spelling Mistake</option> <option value="Spam" <?php echo $spam; ?>>Spam</option> <option value="Other" <?php echo $other; ?>>Other</option> </optgroup> [/code] </select>
  17. the function seems to work on strings...but arrays i cant get it to work on...help?
  18. does anyone know how i can get it to work?
  19. im thinking maybe my.htaccess file isnt working as i have php_value magic_quotes_gpc on help?
  20. k..but how would i allow only port 80 for income traffic?
  21. try this: when on site type: This\'s an string\'s    in name field and see what happens...(funtion doesnt work) http://82.47.43.58/error.php?error=unknown
  22. hey thanks for the reply...i havent got a router..
  23. could anyknow tell me why this wouldnt work please? [code] function toggle_checkboxes(form) { var elements = form.elements; for (var i = 0; i < elements.length; i++) { var element = elements[i]; var type    = element.type; if (type.toLowerCase() == "checkbox") { element.checked = checked_value; } } if (checked_value) { checked_value = false; } else { checked_value = true; } } [code][/code][/code]
×
×
  • 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.