Search results

  1. natsuki

    php classes?????????

    if you have lots of options then you can use switch-case instead of if-else so you don't need to write if ($_SESSION['valuefromdropdown'] == blah) all the time you use classes to group things, in this case the table is a class but more of a struct since there's no functions and the properties...
  2. natsuki

    php classes?????????

    A class is like an object with properties and functions (called methods). You use classes to group things like class Rectangle { public $length; public $width; public function set_size($l, $w) { blah } public function area() ..blah } so you can make...
  3. natsuki

    Password one way encryption.

    the maximum possible values you get in a hash function having n bits is 2^n. The probability that it gets cracked is 1/2^n. If you use m algorithms that hashes into n bits then you're increasing the chance of having a similar hash by m and hence the probability of collision increases to m/2^n ...
  4. natsuki

    uploading a file [PHP / HTML]

    this has something to do with the php script or the server, though i think it's really the server. what files are you trying to upload? it doesn't really matter whether you remove the <label> or not, it won't cause any problems
  5. natsuki

    JS calculations - Can someone tell me what I've done wrong?

    there's also another trick to it. instead of check for if ((sal >= min) && (sal <= max)), you can do the reverse, start from the biggest amount and check if sal > min, if not, then do the next check in decreasing order: if (sal > 150000) // tax = 45% else if (sal > 75000) // you only get here...
  6. natsuki

    Javascript Help

    O_O having a first look at your code if (deposit < target) is suspicious, because the result will always be the same no matter what the amounts are (unless deposit >= target) since you only pass to it once. Then your click should be click(); on the onclick because click alone denotes a variable...
  7. natsuki

    [PHP] cut off 160 chars

    sorry my script looks complicated because it tries to save as much resources as possible so you don't need to save temp strings every time, and i've ironed out all the bugs i could find in it so it's reusable >_< (but the code is actually simpler than yours once you understand it lol) that code...
  8. natsuki

    [PHP] cut off 160 chars

    That's a nice idea using strrpos() instead of looping so I thought of using it as well. But it seems it's limited to single character needles or searches and will still need looping in what I'm trying to achieve. If you can think of a better way to do it, that would be new knowledge to me as...
  9. natsuki

    [PHP] cut off 160 chars

    There are many ways to do it and this one uses the function xPlozion posted. I could have made my own too. $lengthover = strlen($message); $parts = $lengthover / 160; $beg = 0; $msg = array(); do // or a for loop too { $msg_left = substr($message, $beg); $msg_part =...
  10. natsuki

    Not sure, image links

    probably javascript using AJAX, with floating divs and stuffs getting content from xml data
  11. natsuki

    C Dynamic String Allocation

    It's what quantum said. But if you simply remove the -1 in it you might end up crashing. It's like a bug. When you dynamically allocate strings ALWAYS make sure it's the length of the string you want + 1 or else your string will continue till it eats up all your memory or it crashes. It's...
  12. natsuki

    Flash Programming

    if you can get to know how a flash file is made then you can make your own flash files.
  13. natsuki

    Password one way encryption.

    yeah i think doing multiple encryption increases the possibility of words having the same hash, it's because these encryption system uses multi-pass algorithms, but since this is still plain text (actually they just look like hex numbers) and different encryption systems uses different...
  14. natsuki

    Code snippet examples

    we can always hope lol
  15. natsuki

    PHP on LocalHost

    But if you're only setting up for a test server to test php/html then you shouldn't need to go to all the troubles setting up a server as premade packages are available (wampp, xampp, lampp, etc). When the time comes that you'll need your own server, then you'll ought to know how to set-up one...
  16. natsuki

    Php

    if you really want to develop php skills, then the php manual is the definitive resource. either the online version in php.net or a downloadable one
  17. natsuki

    Word Assoation Game

    bytes > int
  18. natsuki

    The Ctrl+V game

    衝 shou
  19. natsuki

    PHP on LocalHost

    then that would be If PHP is not in the server root (usually the Apache dir, find ServerRoot "c:/whatever/it/is" in httpd.conf usually at the start of the file). Then use the full path do it like
  20. natsuki

    PHP on LocalHost

    LoadModule in httpd.conf is like this: httpd.exe is Apache itself, meaning apache is the one having an error. go to line 127 of httpd.conf and check. Or just comment it (put # before it) if you don't really need it lol
Top