Search results

  1. M

    Jar application, what is the classpath?

    The page should have a doctype.
  2. M

    PHP parsing error

    The following should work: AddHandler application/x-httpd-php5 .html Personally, I find the above wasteful, as non-PHP files will still be parsed by PHP. Additionally, Apache can be configured so that file extensions can be left off of URLs, making it easy to change the type of files: Options...
  3. M

    frustrating problem with php and javascript

    One option would be to keep a count of open pages on the server. Add onload and onunload handlers that request pages to increment and decrement the count. When the count is 0 for 1 minute or more, the user's status is "offline" but is still considered logged in. Another option is to have pages...
  4. M

    AJAX file upload system (PHP)

    It's possible to upload a file using XMLHttpRequest under Firefox, but requires the user to set a configuration option and give the script universal access. Instead, use the older hidden <iframe> technique and set the "target" attribute of the form to the name of the <iframe>.
  5. M

    pb PHP using mysql prepare statement

    Further guess: there's a colon rather than a semicolon at the end of the line. At this point, none of the variables you're binding params to (e.g. $utilAGerer) are defined. Either move these lines after you set the variables or pass the values to PDO::execute (which you seem to be using)...
  6. M

    Need simple ajax/php help

    In cases where eval() isn't safe, have the response handler set the content: xmlhttp.onreadystatechange = function(){ if( xmlhttp.readyState == 4 && xmlhttp.status == 200 ){ document.getElementById('txtHint').innerHTML = xmlhttp.responseText; } } ; gethint.php (note...
  7. M

    python and mysql

    It's certainly possible to install manually. The trick is finding a binary distribution of MySQLdb that works on your server. The official build of 1.2.3rc1 is for 32 bit processors, and the servers are 64 bit. Well, Lotus is, but the others should be as well. Should you find or build a 64...
  8. M

    Java Question

    Legal, but discouraged. From section 8.4 "Method Declarations" of the Java Language Specification, Third Edition:
  9. M

    MySQL Functions

    Don't post off-topic to a thread; it's bad netiquette. Start a new thread in the appropriate forum, which is off-topic if there's no other forum.
  10. M

    JavaScript RegEx $1 Tokens

    True of Perl, but not PHP. "$1" isn't a valid PHP variable name; PHP variable names must start with an underscore or a letter. Backreferences of the form "$n" are only supported in regular expressions and replacement strings.
  11. M

    JavaScript RegEx $1 Tokens

    document.getElementById(...) is being called before eqvalue.replace(...) (remember, in f(..., g(...), ...), the call to g(...) must be evaluated before f is called). The solution is to use an anonymous function: var editedExpression = eqvalue.replace(/\{(.+?)\}/g, function(matched...
  12. M

    Java Question

    This isn't a constructor, it's a method named Circle that takes an int and doesn't return anything.
  13. M

    right click JavaScript

    It's fairly easy to have such scripts target only images by registering the handler on images (accessible via document.images) rather than the entire document. This won't provide any more protection, but will greatly reduce annoyance. Another option is to position a transparent image on top of...
  14. M

    Moron question

    Better yet, use prepared statements: change statement to "... WHERE something=:something ...". PHP code looks like: $stmt = $db->prepare('... WHERE something=:something ...'); $stmt->execute(array(':something', $value));
  15. M

    Moron question

    Also check out the thread "SQL for noobs".
  16. M

    All pages giving a wierd compilation error

    C# works. Mono supports quite a few languages.
  17. M

    All pages giving a wierd compilation error

    I keep looking for a question, but I can't seem to find it. In any case, remember that the X10 servers use Mono because they're Linux based. Mono doesn't support .Net 3.5 and isn't 100% compatible with all of .Net 2.0. You can use the tag (click the globe-and-link icon or type one) to...
  18. M

    Getting '0' results from MySQL COUNT()

    The problem isn't a NULL value, it's (as you note in the first sentence above) lack of rows. COALESCE, IFNULL & al. won't help. Not much will help. The OP would need to generate rows for the dates, and SQL is more for manipulating data than generating it. For this reason, an SQL solution will...
  19. M

    Ajax Login ajaxForm() issues

    Much nicer and cleaner.
  20. M

    Crons

    Using a script as the command name only works if the script begins with a shebang line pointing to the command line php interpreter (e.g. /usr/local/bin/php) and the script has executable permissions (mode 750). However, scripts don't process QUERY_STRING when run from the command line, so you...
Top