Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
How are you calling it "directly"? Like post the command or whatever.
-
It has to be: #!/usr/bin/php5 (assuming that is the path to your PHP binary) This is called a shebang. Google it
-
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.
-
I am using other languages as well, but it would be nice if PHP was also well organized.
-
Personally, I wouldn't mind if PHP 6 broke backwards compatibility and got properly reorganized in a logical manner.
-
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.
-
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.
-
Analyzing a string as positive or negative
Daniel0 replied to JoeLongstreet's topic in Application Design
Not without determining the adjective beforehand. Otherwise it would require very sophisticated artificial intelligence. -
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.
-
You have to make sure that you're using UTF-8 or Big5 as your character set.
-
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.
-
VALUES ($userName','$race' Notice anything wrong?
-
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 }
-
[SOLVED] Problems loading files with GET data in path
Daniel0 replied to Mzor's topic in PHP Coding Help
Could you show us the code? -
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.
-
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.
-
For what? It isn't in the manual. http://dk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
-
PHP not using useradd/passwd (linux cmds) correctly.
Daniel0 replied to Sigmaomega's topic in PHP Coding Help
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. -
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?
-
You cannot do this: require_once('../private_folder/user/search_user.php?find_var=$_SESSION['find']'); It doesn't make sense.
-
Use a combination of strlen, if statements and substr.
-
[SOLVED] do I need to be using mysql_free_result
Daniel0 replied to pernest's topic in PHP Coding Help
PHP's garbage collection should be able to figure out that you are no longer using the resource when the variable is overwritten. -
That would actually be really cool. Like an alias that is substituted to the real one during the preprocessing of the post.