Search results

  1. M

    Help Needed With Text Area Script

    You don't need to leave me alone, but start by reading the links, then run a few web searches of your own. Read through the PHP language reference; you'll find all sorts of useful features (e.g. magic methods, iterators). Play around on non-critical projects. Try your hand at SQL injections, for...
  2. M

    Page scrolls to the top after a href is clicked upon which a div is set visible

    When posting code samples, please keep them concise. Most of what you posted isn't necessary for this question. What happens is that the default event handler for clicking on a link is invoked, which opens the URL with a fragment (in particular, an empty fragment "#") appended, which causes the...
  3. M

    Help Needed With Text Area Script

    Please use , [html] or [code] tags (as appropriate) to separate and format code. Rather than dumping your entire script, please post a minimal test case. Use a formatting language and library to parse same, such as BBCode or Markdown. Short tags may not be enabled; don't rely on them. This...
  4. M

    Please advice... OS: Fedora... Problem: httpd config

    What if SeLinux is enabled but mod_security isn't? It sounds like the latter might be the one causing the problems with POST. I'll have to look closely at mod_security configuration, but it'll have to wait for a few other things. Assuming the default action is to block (what's in the...
  5. M

    mysql UPDATE issues

    Sometimes scaffolding is accidentally left in (it's easier than you might think when dealing with a large code base and multiple programmers). Even when it isn't, some form of error handling has to be put in place. Having to replace one set with another is wasted effort. I personally prefer to...
  6. M

    xml help

    AJAX is asynchronous (that's what the first A stands for), which means send() returns before the task finishes, at which point the response isn't ready. Set an onreadystatechange handler to handle the response: xhttp.open("GET","news.xml",false); xhttp.onreadystatechange=function(evt)...
  7. M

    PHP code

    In particular, please provide a minimal test case (else there's too much extraneous code) and a link to a live page. You've already provided a description of what you expect to happen and what actually happens, which is good.
  8. M

    meta description on each page?

    @Mandy0: which ones use keywords & description? It won't hurt to include keywords and description, but it's not worth spending too much time on them. There are plenty of other tasks that should take priority.
  9. M

    meta description on each page?

    The "keywords" meta tag hasn't really been used by search engines since the early '00s, as it is too easy to manipulate. Some might use the "description" tag as a summary on search result pages if they can't generate their own summary. What's important is having semantic HTML to make the page...
  10. M

    string or int as primary key?

    Expanding on lemon-tree's answers: using a string for a primary key may impact both space and time performance. Numeric types are smaller, so indexes and foreign keys on numbers are smaller than those on string types. In particular, indexes and foreign keys will duplicate values; better to...
  11. M

    mysql UPDATE issues

    I write in a no-nonsense style. Tone doesn't come through very well in online communication. I'm sorry if you felt condescended to, that wasn't my intention. It's better I tell others something that they already know than assume they do. Most of the people who posted the above code on this...
  12. M

    PHP execution?

    @mandy0: that doesn't add anything to the conversation.
  13. M

    Please advice... OS: Fedora... Problem: httpd config

    Duh. So we can mostly rule out v. desktop settings. Next thing to test is to create a CGI script in the same folder (since it's configured to run them) and try GETting it and POSTing to it. This should tell us if the issue lies with the PHP module or elsewhere. Are the JS accessed server side...
  14. M

    mysql UPDATE issues

    Besides the injection vulnerability (even though it's an excerpt, you should really be using PDO and prepared statements), if there are no rows with the given date and title (I notice you both select against and update the title), the update will fail. If you're using transactions and don't...
  15. M

    error while giving src for <script> tag

    Do you mean you were doing something like the following? <script src="foo.js"> function bar() { alert("foobar"); } </script> From the specification for the <source> element:
  16. M

    PHP mysql_list_dbs

    Are you sure it takes forever to load, as opposed to generating no visible content? Don't use die when outputting HTML. Rather than the very outdated mysql driver, use PDO. Here's what it would look like <?php try { // LocalDB isn't a standard class; keep reading for more. $db =...
  17. M

    error while giving src for <script> tag

    If it's too cumbersome to post, it's likely too cumbersome to look through on a live page, which is why I said to create a minimal test case. Read my sig. IE8 (if that's what you're using) has its own debugger. From what I recall, you don't need to install it. As for the linked page, the only...
  18. M

    error while giving src for <script> tag

    "object expected" indicates that the script is loading and trying to access an undefined value. We'll need to see some code, a minimal test case. We'll also need a link to a live page for the minimal test case and an indication of which line is generating the error (mark it with a comment). Note...
  19. M

    apache mod_pagespeed

    Then why post? If you're hoping to avoid an inactivity suspension, you just need to log in, not post. If you're looking for something to do when logged in, read the news and announcements.
Top