Jump to content

xiao

Members
  • Posts

    163
  • Joined

  • Last visited

    Never

Everything posted by xiao

  1. Well, if it has to run exactly every 34 seconds or every hour, you won't have time to sleep...
  2. This is my function: function regio($postcode){ switch(TRUE){ case($postcode<1000): //Invalid $regio = 0; break; case($postcode>999 && $postcode<1300): $regio = "Brussel"; break; ..... case($postcode>8999 && $postcode<10000): $regio = "Oost-Vlaanderen"; break; default: //Invalid $regio = 0; break; } return $regio; } And I use this code: $regio = regio($postcode); //Kijken of regio geldig is if($regio == 0){ $msg = "<p class='fail'>Invalid Postal Code!</p>"; }else{ ... I used this to test: $postcode = 2000 I always get the "Invalid Postal Code!" message... Even when I change $regio = 0 in my function to $regio = 1 :-\ I'm sure it's something really noobish, but what am I doing wrong here? ???
  3. thank you, so my problem's somewhere else then...
  4. How would a regex for a 4 digit postal code like this look like? 2390 - First number is 1-9 - #2 and #3 are 0-9 - Last is always a 0 I tried preg_match('^[1-9]{1}[0-9]{2}0$', $postcode) And preg_match('^[1-9]{1}[0-9]{2}[0]{1}$', $postcode) But they always give a false.
  5. and how would you echo that in a textarea? Because I use <code> <?php echo nl2br($str); ?> </code> And I still have \r\n\r\n in the string.
  6. How can I store text with linebreaks in them from a text area, and later echo them back in a PHP page? (I don't need colors and bold etc, only the linebreaks)
  7. Who on Earth would be naive enough to put a laptop in a locker, or bring it to high school (or lower) in the first place? I don't know about you guys, but where I went to school, anything valuable in locker == stolen. And who would want to stand there in front of their locker to use a laptop? ... Nothing ever gets stolen from our lockers. And you don't use it in front of your locker, you set some downloads in a cue and put it in your locker for downloading.
  8. A handy rack to place a laptop on (and maybe a built-in wireless antenna to which you can connect your laptop for good connection) to use the school's wireless broadband for a day of downloading.
  9. I have this PHP-book, and after every chapter there are exercises, but there aren't any solutions online, so I'm gonna ask you gurus I had to make a regex for a serial number: A16B947-c All characters can go from a to z, all numbers from 0 to 9, there's a difference between caps and no caps. This is what I had: <?php function valid_serial($str){ return(ereg('^[A-Z][0-9]{2}[A-Z][0-9]{3}-[a-z]',$str)); } ?> <form method="post" action="p97-1.php"> Serienummer: <input type="text" name="serial" /> <input type="submit" value="Valideren" name="valideren" /> </form> <?php if(isset($_POST['valideren'])){ $str = $_POST['serial']; $output = valid_serial($str); if($output == FALSE){ echo "<b>Fout!</b>"; } if($output == TRUE){ echo "<b>Juist!</b>"; } }
  10. xiao

    Null/Not Null

    What does this argument do? Does it mean the field is required? What if I set to NOT NULL, but don't give it a value when inserting data, do I get an error?
  11. Anyone else finds something?
  12. I wish I could even GET freelance projects
  13. $page = filter_sanitize_int($_GET['page']); (line 19 in matches.php) I also tried using caps, but that doesn't work either. When I type filter and press ctrl+space in phpDesigner, it gives filter_sanitize_number_int as an option. I found a line in php.ini loading php_filter.dll and I uncommented it, but there's no php_filter.dll in my extensions folder. Nor in the one I downloaded. And the error: Fatal error: Call to undefined function filter_sanitize_number_int() in C:\xampp\htdocs\league\matches.php on line 19
  14. Thank you basename($_SERVER[’SCRIPT_FILENAME’]) seems to work just fine too
  15. I have v5.2.2, and in phpinfo(), there's a tabel named Filter. I don't see why they aren't recognized :s
  16. I think I've figured out what to add to the php.ini file, but I have no idea which dll I need. The names don't look too obvious to me.
  17. I forgot to delete that log, it's stored somewhere else now. How can I fix the Expect Header vulnerability? Or can only my Host do that?
  18. Link I've made this script for my CS:S clan. I love coding in PHP, but I don't have any inspiration for extensions anymore... Does someone have any suggestions? Thank you
  19. I've made this script for my CS:S clan. Link You can click quite some numbers on the index page, changing GET variables. There's also an admin panel somewhere.
  20. so strip_tags($_SERVER['PHP_SELF']) ?
  21. How do I update XAMPP? Just download the newest installer? Will all my settings and htdocs be untouched?
  22. what would that line look like? And which .dll file would I need?
  23. Why does Acunetix report this then? Cross Site Scripting in URI ... This XSS variant usually appears when a PHP script is using one of following variables without filtering them: PHP_SELF REQUEST_URI SCRIPT_URL SCRIPT_URI ... This vulnerability affects /league/matches.php/>"><ScRiPt>alert(1674394882)%3B</ScRiPt>.
×
×
  • 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.