Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Destramic

  1. 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]
  2. <?php echo $id; ?> using php at the opening tag is good practice...sorry
  3. 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; } ?>
  4. 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]
  5. index.php?id=0001&var=22 [code] <?php $id  = $_GET['id']; $var = $_GET['var']; echo "id:" . $id; echo "var:" . $var; ?> [/code]
  6. check_value gets defined here: if (checked_value) { checked_value = false; } else { checked_value = true; }
  7. there should be a way of changing the css class of a select box easily?
  8. 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
  9. 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:
  10. anyone know how i can stripslashes on array?
  11. 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>
  12. the function seems to work on strings...but arrays i cant get it to work on...help?
  13. does anyone know how i can get it to work?
  14. im thinking maybe my.htaccess file isnt working as i have php_value magic_quotes_gpc on help?
  15. k..but how would i allow only port 80 for income traffic?
  16. try this: when on site type: This\'s an string\'s    in name field and see what happens...(funtion doesnt work)
  17. hey thanks for the reply...i havent got a router..
  18. 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]
  19. i have my apache server up and running fine...all im wondering is is it possible just to have a single port open so that people can connect through and see my website when i send link over...? if so how can i do this please? thanks destramic
  20. i have a function which will stripslashes in a string but doesnt seem to be working when i stripslashes on my forms values....can anyone help? (dont think it works at all) [code] 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); } } else { return $value; } } [/code] destramic
  21. rofl...thats not my site i just typed that in as a example....but that doesnt work on my site...dont know why it did before..
  22. im having problem getting my .haccess file to function...for some reaon if i type 'http://www.domain.co.uk/spammmmmmm'  it wont see to load error.php?error=404 as i would like it to...same as DirectoryIndex if i set it to error.php it will just still load index.php as that is what it is set in apache config file..very confusing...can anyone help please? [code] ErrorDocument 400 /error.php?error=400 ErrorDocument 401 /error.php?error=401 ErrorDocument 402 /error.php?error=402 ErrorDocument 403 /error.php?error=403 ErrorDocument 404 /error.php?error=404 php_value magic_quotes_sybase off php_value magic_quotes_gpc on php_value magic_quotes_runtime on DirectoryIndex index.php [/code] thanks destramic
  23. [code] $query = "SELECT news_id,     game_id,                 subject, DATE_FORMAT(date, '%d/%m/%y %r') AS date  FROM news  WHERE status = 'Active'  ORDER BY news_id ASC  LIMIT 5";   // Execute query $result = $mysqli->query($query); // Check query execution if ($result) { while ($row = $result->fetch_array()) { $news_id = $row['news_id']; $game_id = $row['game_id']; $subject = $row['subject']; $date    = $row['date']; $todays_date = gmdate("d/m/y"); if ($todays_date == $date) { echo "Today [time]"; } echo "<img src='".$document_root."/images/game_icons/".$game_id.".gif' alt='' width='16' height='16' />\n"; echo "<a href='news.php#news_id=".$news_id."'><strong>".$subject."</strong></a> ".$date."\n"; } // Free result $result->close(); } [/code]
  24. nope sorry it didnt work..cause what im trying to do is if the pnews post date is the same as todays date i want it to display today and time. thanks
  • 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.