Search results

  1. M

    Using PHP to backup and load Mysql DB

    SELECT TABLE_NAME FROM TABLES will include tables that you don't want to back up and doesn't tell you which database each table is in. You could use SELECT TABLE_SCHEMA, TABLE_NAME FROM TABLES to get the database and table or select a database and use SHOW TABLES. A multi-value INSERT is more...
  2. M

    Using PHP to backup and load Mysql DB

    Only admin accounts would have permission allowing INTO OUTFILE, also for security reasons. You can use a normal SELECT * FROM <table> and have your script format and save the results itself. More work for you, but not much more. If you want a full, completely automated backup, start with a...
  3. M

    PHP MySQL communication basics

    You can use a hostname of "localhost" to connect to MySQL server running on the local computer, yes. Note that "localhost" is not treated exactly the same as "127.0.0.1", though the difference is usually unnoticeable, and beneficial when it is noticeable. When you connect to "localhost", the...
  4. M

    SWF help.

    It's probably because the <image> elements contain a relative URL. When you load flvplayer.html, the relative URL is translated to http://podaci.selfip.net:8080/hr/poster.jpg, which doesn't exist. When you load the movie player directly, the relative URL resolves to...
  5. M

    AJAX bookmarking/forward/back

    This isn't what you're looking for, but are you sure that site should be using AJAX the way it does? Your site isn't application-y, it's web page-y, which suggests AJAX is not the best thing for your site. Read over: Where and when to use Ajax in your applications When to use AJAX programming...
  6. M

    PHP MySQL communication basics

    While you could view tables like spreadsheet sheets, the model behind MySQL is quite different and you'd probably make many mistakes. MySQL is based on relations (well, relationships, but it's a technical difference that isn't too important) and operations on relations. In the model...
  7. M

    SQL errors and PHP

    The important part of my answer is: "Within double quoted strings (and heredocs), variables are interpolated." The statement about single quotes is just an aside, noting that single quotes within double quotes do not function as single quotes outside of strings (i.e. single quotes do not prevent...
  8. M

    SWF help.

    Note that in flvplayer.html, the flash variables are not part of the player URL. You could try adding "image=flash/poster.jpg" to the movie URL ('movie: "flash/flvplayer.swf"' in the script).
  9. M

    SQL errors and PHP

    Within double quoted strings (and heredocs), variables are interpolated. Single quotes within double quotes are not special, they're just characters. For collecting more information about failures, don't forget about driver specific error functions (eg mysql_error(), mysqli_error()). You can...
  10. M

    Microsoft SQL Server (a rant)

    That will probably turn into a bigger project than you expect. SQL is for people who want to use a DBMS. A DBMS is so you don't have to implement your own datastore. Here's some of what you get with an RDBMS and SQL: data persistence sharing data between sessions data integrity, including when...
  11. M

    Modify Post Headers

    Read the HTTP/1.1 spec section on 3XX responses. Redirects cause the browser to reissue the original request. There's no mechanism for either the server or the browser to alter the request. A working alternative that skips the redirect entirely is to generate the values on the last non-PayPal...
  12. M

    Password handling

    If you're hashing passwords, make sure you use salt. System wide salt prevents rainbow attacks (attacks using a standard dictionary precomputed before getting your system's password data). If you only use system salt, a cracker can still produce a rainbow table for your system. Using both system...
  13. M

    JavaScript strip tabs function

    String.repeat isn't a standard method. One possible reason why the code wasn't working is that the script that defined String.repeat wasn't included with the page. Another problem with the same line is that String.substring(i, j) doesn't include the character at the latter index j, so the...
  14. M

    Microsoft SQL Server (a rant)

    Why learn SQL? Because it's the biggest game in town. It's not the best language for the task (Edgar Codd, the formulator of RDB theory, is attributed as criticizing SQL as being an incorrect implementation of the theory), but all the major RDBMSs (Relational Database Managment Systems) use it...
  15. M

    Internal server Error - what should i do?

    socket_accept is most likely disabled to prevent abuse. Unless you're on a VM, your site is not supposed to run anything that has high resource utilization, which includes services. Considering that a PHP script would bind a port every time the page loads, the potential for abuse, whether...
  16. M

    map-mail-compose php return_path

    Take a look at the arguments to imap_mail, specifically the $rpath argument.
  17. M

    Javascript help

    All you need to do is put everything in the first script tag in a file named "ufo.js" in a subdirectory named "js": var UFO = { ... }; if (typeof window.attachEvent != "undefined" && UFO.uaHas("ieWin")) { window.attachEvent("onunload", UFO.cleanupIELeaks); } player.html becomes very...
  18. M

    Javascript help

    Studying other code is helpful, but you miss out on principles. Find a good javascript tutorial (I wish I had a link to recommend, but I learned another way) or book (O'Reilly publishes good quality books). JS is a fun language to program in, so I highly recommend learning it. JS has a number...
  19. M

    Javascript help

    Perfect time to try out Firebug. What languages are you familiar with?
  20. M

    Javascript help

    Check the error console when you visit the page (always the first thing you should do when debugging JS). In FF, the error you get is: Line 52 is in method 'main(id)', which is called from 'domLoad(id)', which is called from 'create(FO, id)', which is called from the last embedded script as...
Top