Search results

  1. M

    database connection

    That's not a minimal test case, that's a code dump. You didn't post the error message: You also failed to tag the code appropriately: Fortunately, you can edit your post and make corrections. A quick glance at your code and it appears to use a table based layout. Don't do this...
  2. M

    Issues with Javascript?

    I understand your personal need for sample code to examine, but this isn't an interactive tutorial, or, indeed, any kind of tutorial. It's a forum thread, which is why I linked to the tutorials. And one page of yours probably won't be sufficient, because, for each page, there might be some...
  3. M

    Need help with theme

    Since $limit is passed as an argument to wpn_content_show (and thence to wpn_content_limit), you need to find where wpn_content_show is called. There are other approaches, but that's the best.
  4. M

    Flash Player, An Image Gallery, Not loading in php, but loads directly

    If a reference to the XML file (is it a playlist?) doesn't appear in the source, it's probably hard-coded (at least, there's a hard-coded default) in the flash movie.
  5. M

    Security problem with history button

    What, exactly, is the issue? As I understand it, here's where things stand: Scripts in the "inc" directory cannot be accessed directly by a browser (e.g. "http://fomalhaut.x10hosting.com/inc/auth.php" is forbidden) but can be included by other scripts, which is as it should be. Some of the...
  6. M

    [PHP] MySQL and PHP

    Personally, I like something similar to: <?php class DB { static $db = array(); public var $connection; protected var $dbName; // may throw a PDOException function __construct($dbName='') { $this->dbName = $dbName; $this->connection =...
  7. M

    database connection

    What, exactly, isn't working? You posted a good minimal test case, but are missing a description of the behavior you expect and the behavior you get, which includes any error messages. When posting code, surround it with [code], [php] or [html] tags (as appropriate) to format it. Don't use the...
  8. M

    My x10 hosted site marked as "distributing malware" by google!

    JS files should be 644, though you could probably use 600. Only directories and scripts that need a shebang line (e.g. CGI scripts) need execute permissions. Scripts handled by Apache (e.g. PHP) or the browser (e.g. JS) aren't executed as commands and don't need shebang lines or execute...
  9. M

    Issues with Javascript?

    The problem with learning from code is it's hard to extract the principles behind it, unless you happen to be Alan Kay. As for dealing with other's code, you're right in that I don't have to deal with it directly, but all our pages live in a larger world. We have to design for the search...
  10. M

    Need experts' opinion

    While it's conceptually easier ("a file is a sequence of characters, and has a read/write position" is simpler than the RDB model), it's harder to implement. When you use a database, you get a number of features for free that you otherwise need to implement when using flat files. XML is a whole...
  11. M

    PHP support on my site

    In particular, be explicit about what isn't working. Describe the behavior you expect and the behavior you get (which includes errors). If you wrote the code, include a minimal test case that generates the error. Read also "When asking about code" for a little info on minimal test cases.
  12. M

    Forbidden 403 Error - New User

    Also check that ~/public_html has universal read and execute permissions, which you should also be able to do from an FTP client or cPanel's file manager.
  13. M

    AJAX loading image in login page

    Try Firebug and you'll see what's going wrong. Seriously, Firebug should be your best friend. The "undefined" in "Error: The description is: undefined" arises because "response" is a string and doesn't have a "description" property. Even if it weren't a string, it probably wouldn't have a...
  14. M

    Issues with Javascript?

    It's pretty bad, to be honest. Invalid HTML (the particular errors show a deep misunderstanding of HTML), tables for layout... It needs much work, relative to the size of the file.
  15. M

    PHP - Can not seem to figure this out?

    All together: <?php include_once('init.php'); include_once('DB.php'); $actions = array('vote_up' => 'votes_up', 'vote_down' => 'votes_down'); $action = $_POST['action']; if (!isset($actions[$action])) { echo "You asked me to perform an action ($action) I don't know how to do." } else try {...
  16. M

    PHP - Can not seem to figure this out?

    I was going to say that "there's nothing in the posted code to print the line twice, so the problem lies elsewhere". Instead, some feedback. For one thing, there's a security hole. Just want to make sure you know about include_once. In some cases, it's better to make sure a file isn't included...
  17. M

    mySQL error - argument is not a valid MySQL result resource

    Make sure your scripts handle errors properly. This means catching exceptions and testing return values (and throwing exceptions and returning error values, when appropriate, as the point an error is detected is often not the point it can be handled), and giving useful information in error...
  18. M

    Need experts' opinion

    The more I look at W3Schools, the less I like it. Second page in to the JS tutorial and they're using document.write. W3Schools is terribly out of date; much of what you'll learn you'll later have to un-learn. Tizag Tutorials is a little better, but not without its faults. Read my response in...
  19. M

    Issues with Javascript?

    Take a look at "HTML tutorial - The Basics and "Semantics, HTML, XHTML, and Structure" for more of an introduction.
  20. M

    AJAX loading image in login page

    You don't need to know about JS, you need to know about programming. Read up on scoping (which exists in basically every language since the '70s). Variables defined in one function are not visible in another; you must pass them as arguments. Something like: function ajax(username, value){...
Top