Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Ingolme

    Custom Exception

    echo $e; will call the toString method. If you call $e->getMessage() then you'll only get the message.
  2. Is this a PHP question?
  3. jQuery is designed to be cross-browser compatible, so there's nothing wrong witht he click() method. I'd have to see the page in action to see what's wrong. Have you checked the Javascript error console? This isn't the cause of your problem but you created an element called <image> instead of <img>
  4. Try print_r($_POST) to see if anything got there at all.
  5. There's a solution to the problem here: http://www.quirksmode.org/js/findpos.html I use it all the time.
  6. I think they were trying to prevent the little dotted outline that appears on focused elements. There's an easier way to fix that, though: a:focus { outline:none; }
  7. The data property contains the data that will be sent to PHP: data: {ref : ref}, This data is received in PHP as $_POST['ref']
  8. Firefox. Going through doors seems to load one part of the stage and then immediately bring me to another part of the stage. Sometimes two doors bring me to the same place, I'm not sure if that's supposed to happen.
  9. It seems to work fine. Sometimes when going through doors half the stage isn't loaded. If I happen to walk into a place that a wall is going to appear in I get stuck inside the wall and can't move anymore. I couldn't clear the maze within the time limit. One problem I find with the game is not being able to move if I'm touching a wall. It slows down the flow of the game a lot. Pressing enter while in the dark maze brings me back to the title screen but the timer keeps going on.
  10. Ingolme

    Custom Exception

    Just call the parent's constructor class MyPDOException extends Exception { public function __construct($msg, $code=NULL) { parent::__construct($msg, $code); }} Here's the PHP manual's explanation: http://es1.php.net/manual/en/language.exceptions.extending.php
  11. Using document.write() will delete everything that's currently on the page. When looking for any element after that it won't be there. Try something else besides document.write.
  12. Changing i < fields.length for i < 3 would work.
  13. Did the error console tell you anything? Prepending that with "var" makes the whole statement a syntax error. I'd do it this way: var fields = (url == "" ? ['address', 'city', 'municipality'] : ['address', 'city', 'νοmunicipality','url']); If url isn't set the program will throw an error.
  14. The browser has to turn percentages into pixels before rendering the page. The CSS specification doesn't say what to do with the decimal part of a pixel. Some browsers truncate, some browsers round and some might round up to the next value. if 1% is 4.9 pixels, some browsers might round it down to 4 pixels while other round up to 5. Try something like this instead: 0.95% 23% 0.95% | 0.95% 23% 0.95% | 0.95% 23% 0.95% | 0.95% 23% 0.95% -------------------- ---------------------- ---------------------- ----------------------
  15. "false" is a value. It's a boolean value indicating that a condition is false. If you're not planning to do anything with the return value of the function there's no different between null, false, "n" or 5. A function might return false if something didn't work properly and other values if it did work. You return null if you don't expect the function to return anything the developer wants.
  16. Ingolme

    php array help

    On thing I notices is that you still need the square backets here in order to add elements to the array: $items[] = array( As for the uninitialized string offset error, check and make sure that $row isn't a string.
  17. If you have your database login information in a file anywhere then this is a security threat. To be safe, remove any / or from the path and restrict the files to one directory that you know doesn't have sensitive information. Using file_exists() first to show an error if the file isn't found would also be a good idea.
  18. It seems to be a mistake in the person's code. Try removing the PDO::FETCH_BOTH to see if the result is the same.
  19. When the event handler is called, local variables are created. When the event handler finishes executing the variables are destroyed. No memory leaks or efficiency problems.
  20. Clearly the files or the folder they're in are being protected by the server. Go to your FTP and check the permissions.
  21. I made the same mistake again. "i" isn't set because the function isn't executed during the loop but later on. I think it's best to just do it without a loop for now.
  22. Oh, wait. this is event handler, the value of i gets lost after the event handlers have been assigned. There are many possible solutions, but I guess best thing you can do is this: for(i = 1; i <= 10; i++) { $("#pictures" + i).click(function(){ $("#roll" + i).show(); });}
  23. It depends on which CMS, of course. They probably explain the plug-ins in their documentation.
×
×
  • Create New...