Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. THe $(document).ready() listener is not needed here, just put the slideDown() call right in the load() callback. If SQL queries are visible right in the loaded content then it sounds like your server isn't executing the server-side code which isn't a jQuery issue. I wouldn't be able to tell you what's wrong with the height without seeing a live example of the problem.
  2. You can give the script more time to execute by using set_time_limit(). By default PHP only runs for 30 seconds at most.
  3. Ingolme

    Matrix 3d() help

    I would just stick with the tranlate3d(), rotate3d() and scale3d() values instead of messing with the matrix. They're easy to use. http://www.w3schools.com/cssref/css3_pr_transform.asp
  4. Ingolme

    hash in PHP

    MD5 is not a secure hashing algorithm. It's far too easy to crack. See details right in the PHP manual: http://php.net/manual/en/faq.passwords.php#faq.passwords.fasthash Consider using PHP's crypt() function with Blowfish or SHA-512 algorithms. addslashes() (not stripslashes() because that doesn't escape the code at all) is not a sure way to prevent injection, use escape_string(), but even that is not ideal. Ideally, you would use Prepared Statements
  5. I would serve just the desktop styles to IE8 because, as far as I know, no mobile devices have IE8 on them.
  6. Ingolme

    Matrix 3d() help

    m13 and m23 would indicate the Z coordinate of the X and Y axes. m31, m32 and m33 would be the X,Y,Z coordinates of the Z axis. The 3D matrix is complicated, there's a lot of algebra behind it. Multiplying the matrix by a 3D coordinate would cause that coordinate to change. This matrix is similar to the Model-View matrix used by OpenGL http://www.songho.ca/opengl/gl_transform.html#modelview
  7. Floated elements aren't taken into account when calculating the height of their parent element. To fix this, set the overflow property of the parent (in this case, the .menu element will work) to "hidden" or "auto"
  8. You should read the documentation. Here's the description of input(): https://docs.python.org/2/library/functions.html#input In other words: The user's input is evaluated as Python code. I would not recommend using this.
  9. Ingolme

    !Doctype

    The original purpose of the document type declaration was to tell the browser the rules that the document follows. In HTML, it doesn't serve that purpose anymore. The browser uses the doctype to determine which version of HTML is being used and how to render it. An invalid doctype, an old doctype or no doctype at all will cause the page to render in quirks mode, which is the way browsers used to render pages over 10 years ago. This was for backwards compatibility on pages built with HTML 3.2 and older. Specifying a valid HTML 4.01, XHTML or HTML 5 doctype will make the browser render in standards compliant mode, in which browsers all render things the same way, theoretically. It's important to build your pages in standards compliant mode. The page davej linked you to has a list of all valid doctype declarations. I would not recommend using HTML 4.01 or XHTML anymore, they're already getting old. Use HTML 5.
  10. The raw_input() function only returns a string, here's the documentation: https://docs.python.org/2/library/functions.html#raw_input The question is what are you doing with result given by raw_input()? If you're just printing it, then you won't notice a difference. If you try to operate mathematically with it, there will be a difference. Casting to integer will prevent problems such as what would arise if the user gave a value such as "a" or "3N"
  11. The result of raw_input() is most likely a string, which means you can't operate mathematically with it. It needs to be cast to an integer first.
  12. I haven't found a good resource explaining why it works, but my guess is that the browser needs to take the floated content into account in order to determine what should and shouldn't show when there's an overflow. There's a more complicated method you can use if your element has a fixed width or height and needs to show overflowing content. It's this clearfix: http://nicolasgallagher.com/micro-clearfix-hack/ I've rarely encountered a situation where I needed it, but it has come up before.
  13. I don't know the full structure of the data. When copying the output of var_dump() to the forum, copy it from the page's source code so that it's formatted and easy to read. Put it into a code block.
  14. You can't do that with jQuery. You need to program that in Javascript. It's called a collision detection algorithm. The simplest ones are either rectangular collision testing or circular collision testing. Looks like MDN even has an article about it: https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection You're entering the realm of game development, I warn you that nothing is easy in game development.
  15. This should work as long as the element's position property is set to "relative" $('.thing').animate({left: '10px'}, 500);
  16. "+=10px" isn't a valid CSS value. What are you trying to do?
  17. You have to run json_decode() on that first. What you should have is an associative array or object, not a string.
  18. It has zero height because the content inside it is floated. Floated elements are ignored when calculating the height of their parent. This can be easily solved. Setting its overflow property to "hidden" will force it to wrap around floated elements.
  19. You can cast to number before operating: localStorage.gold = Number(localStorage.gold) + tempCount;
  20. Did you manage to decode the JSON? If you have done that, you can use var_dump() on the resulting object to see its structure. Show the structure here and I can give you an idea of what procedure needs to be followed to pull data from it.
  21. All it takes is structuring your code properly. I assume you know what you want your code to do. I don't have the requirements for your project.
  22. You have a lot of nested loops there. Of course it's going to send multiple e-mails. You should properly indent your code, your braces don't match. This is the structure your current code has: while($row = mysqli_fetch_array($sql_level, MYSQLI_ASSOC)) { [ ... ] while($row = mysqli_fetch_array($query_does, MYSQLI_ASSOC)) { [ ... ] while($row = mysqli_fetch_array($sql_email, MYSQLI_ASSOC)) { [ ... ] foreach($all_e as $key => $e) { [ ... ] $mail = mail($to, $subject, $message, $headers); [ ... ] } } If A is the number of rows in $sql_level, B is the number of rows in $query_does and C is the number of rows in $sql_email then the total number of e-mails sent will be A · B · C · (C + 1)/2 which is a whole lot of e-mails.
  23. Does the database server you're trying to connect to belong to the same web host as the page your site is hosted on? And just in case, be sure you're providing the right password for the database login.
  24. $links1 is a DOMDocument node, not a string, you need to get the string out of the node first.
×
×
  • Create New...