Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. Which language are you going to use? You would need to load the document and do a full tree search of the XML DOM, then rewrite the data in a list form. The data can be ordered by depth-first or breadth-first and in the case of depth-first, by pre-order, in-order or post-order.
  2. Printers usually ignore a lot of styles to save ink. You can use a print stylesheet to make sure that your styles are kept: <link rel="stylesheet" type="text/css" href="print.css" media="print">
  3. There is no spellcheck attribute according to the reference.
  4. Which part of the tutorial are you having trouble with?
  5. It depends on the exact behavior you want. You may be able to use a GET request to have a server-side language load the table, passing a parameter to the URL. It has two advantages: It can be remembered by search engines and it doesn't mess with the browser history.
  6. CSS can animate, but it's not a programming language, you will need to use Javascript and apply geometry.
  7. Yes, it can be done using the preventDefault() method and then making Javascript do something based on the key code.
  8. XHTML closes empty elements with a slash, HTML does not. The same goes for elements such as <br />, <link /> and <input type="button" />
  9. Ingolme

    single quotes

    Not necessarily, but you need to read the code from left to right. When a quotation mark appears, the string is open, when the same type of quotation mark appears again the string is closed. Syntax highlighters do this for you. You should be able to see clearly here: $paginationCtrls .= '<a href=" ' . $_SERVER['PHP_SELF']. '?pn=$previous">Previous</a>';$paginationCtrls .= '<a href="$_SERVER['PHP_SELF']?pn=$previous">Previous</a>'; You can use double-quotes and complex string syntax. That requires escaping any double-quotes that are in the string with <?php$paginationCtrls .= "<a href="{$_SERVER['PHP_SELF']}?pn=$previous">Previous</a>";?>
  10. Ingolme

    class inside class

    The ">" selector selects an element that is an immediate child of another. In your example, this would be selected: <div class="flip3D> <div class="back"></div></div> But this wouldn't: <div class="flip3D"> <div> <div class="back"></div> </div></div>
  11. I would recommend installing forum software. It is made in PHP and uses MySQL databases. Here's a list of forum software you can install: http://en.wikipedia.org/wiki/Comparison_of_Internet_forum_software Some of them cost money, but SimpleMachines and PHPBB are free. As for programming a forum, a properly done forum would probably take me half a year. There are so many little details needed in making a forum work as good as existing software.
  12. Yes, it's part of the HTML 5 standard. However, perhaps there is a better way to implement the functionality into your website.
  13. Ingolme

    canvas

    No, I don't believe they would write ctx.id because that wouldn't work. You get a context object from a canvas element. var ctx = canvas.getContext("2d"); If you somehow lost the reference to canvas but you still have the context you can get back to the canvas with var canvas = ctx.canvas;
  14. It would take quite a bit of effort even from somebody experienced.
  15. Iframes can be used to manage sessions with HTTPS while the rest of the page is served through HTTP. They have been used frequently for AJAX file uploads. They're used for WYSIWYG editors like the one I'm using right now to write this post.
  16. PHP has a few methods to interface with the operating system: http://es1.php.net/exec I don't have a whole lot of experience with it since I never need to work outside the PHP environment.
  17. Since you're starting off with 2, you're adding one more to the exponent. You can start with var i = 1
  18. They probably aren't recognized as PHP files because the server doesn't execute .class and .function files. You can either rename them to .class.php and .function.php (I recommend that) or tell the server to execute .class and .function files by adding this to the apache configuration file: AddType application/x-httpd-php .classAddType application/x-httpd-php .function
  19. Ingolme

    crypt()

    You should read the manual page for it, since it's a lot to explain. The PHP crypt() function takes two arguments: The string you're encrypting and a salt. The function chooses an encryption method based on what methods are available on the server and what salt you provided. The manual page tells you how to format the salt for each different encryption algorithm.
  20. Here's what's happening: When loading the current page's URL with a hash the page does not reload. Since the page does not reload, the window.onload method isn't called. There's a hashchange event to deal with this. You can change your code to the following: window.onload = doSomething; // Call the function if the page is loading for the first timewindow.onhashchange = doSomething; // Call the function when the #hash changesfunction doSomething() { var id = location.hash.substr(1); document.getElementById(id).className = 'class2'; }
  21. I see a lot of useless things in your code. It could be rewritten without any parameters and without the need for some of the functions.
  22. Are the characters really unwanted? I don't see a problem with somebody putting a < in their description as long as it doesn't interfere with the HTML.
  23. Against HTML injection I use htmlspecialchars(). I advise doing it when retrieving the data from the database rather than when putting it in.
  24. As long as you're using prepared statements properly you won't have problems with SQL injection. There are other things to have in mind, like HTML injection. A user could mess up your site if you let them use HTML in the inputs.
  25. The syntax seems fine. What are the exact words of the error message?
×
×
  • Create New...