Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. How are you calling it "directly"? Like post the command or whatever.
  2. It has to be: #!/usr/bin/php5 (assuming that is the path to your PHP binary) This is called a shebang. Google it
  3. The typical course of action is to ban the most recently registered account and tell the user to use the first one. However, it will be decided on a case-by-case basis. Your best choice would of course also be honesty. Simply contact an admin, tell it like it is and we'll figure something out. Although SMF doesn't natively support it, we might even be able to merge the accounts if it doesn't involve too much work. I can't think of any case off the top of my head, but again, we'll decide on a case by case basis depending on the circumstances. It's not something that happens very often because it's difficult figuring out if two accounts belong to the same person. We don't automatically infer that two accounts having the same IP address means duplicate accounts. The rule is one account per person, not one account per IP address.
  4. I am using other languages as well, but it would be nice if PHP was also well organized.
  5. Personally, I wouldn't mind if PHP 6 broke backwards compatibility and got properly reorganized in a logical manner.
  6. Because pop and push operates on a stack, i.e. in a LIFO like manner. The function you're looking for is called array_splice.
  7. You'll have to clarify that. URL routing just means routing a particular URL to a particular resource. Here you go: if ($_GET['page'] == 'register') { require 'register.php'; } There is no particular way you might want to do it. It really depends on your needs and how it needs to fit into the rest of your application.
  8. 1) The readfile should just be: readfile($uploaddir . $PDFtoview); 2) It'll not work with all the HTML stuff below.
  9. Not without determining the adjective beforehand. Otherwise it would require very sophisticated artificial intelligence.
  10. That would depend on how you implemented the suggested plural \s escape sequence. There is not following anything that can be interpreted as an integer, so you could do two things: 1) ignore it and return verbatim, or 2) remove the \s. Because PHP is eagerly evaluated, argument parameters are evaluated before they are passed on to the functions. Therefore, substitutions in a double quoted string would be done before preg_match() even gets to take a look at it. If you wanted the PCRE \s you would have to either 1) use a single quoted string, or 2) escape the escape sequence.
  11. You have to make sure that you're using UTF-8 or Big5 as your character set.
  12. You can use a trigger. Look it up in the MySQL manual. You can also just use the same user table for all your forums. That might be difficult depending on how it's coded.
  13. VALUES ($userName','$race' Notice anything wrong?
  14. Why are you writing a file like that for all of them? Why not do like this instead? if ($hasPicture) { // output it, or show an <img> to it } else { // generate one }
  15. Could you show us the code?
  16. Whale crazy.
  17. Yeah, that's what I'm saying. It wouldn't result in any ambiguity because the parsing rules already dictate what would happen if \s was a valid escape sequence for double quoted strings.
  18. Well, I know it's used for regex, but I don't see how that has anything to do with regular strings. The dollar sign also has special meaning in PCRE even though it's also used for variables. The string is parsed before it's passed to functions, so there would be no ambiguity. For instance, these will be parsed differently, but will do the same thing anyways: preg_replace('#\n#', '', $str); // vs preg_replace("#\n#", '', $str); I don't think the suggested feature is a good idea though.
  19. For what? It isn't in the manual. http://dk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
  20. You're never setting the password, so obviously you cannot login. As thorpe said, passwd expects you to type in a password when you've called it. Your escaping won't work either, by the way.
  21. Seems like a lot of work and extra overhead for a minor convenience feature. Anyways, if you want it in PHP then why not propose it on internals?
  22. You cannot do this: require_once('../private_folder/user/search_user.php?find_var=$_SESSION['find']'); It doesn't make sense.
  23. Use a combination of strlen, if statements and substr.
  24. PHP's garbage collection should be able to figure out that you are no longer using the resource when the variable is overwritten.
  25. That would actually be really cool. Like an alias that is substituted to the real one during the preprocessing of the post.
×
×
  • 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.