Search results

  1. M

    decode/encode

    @Skizzerz: I bet you've got the skill to write the script in about the same amount of time it took to do it by hand. It's that special brand of virtuous laziness that can benefit others.
  2. M

    decode/encode

    You can also have PHP do all the work using preg_match to pull out the encoded data, then calling gzinflate ∘ base64_decode on same in a loop, but I'm lazy that way. However, it seems imprudent to post code that defeats an encoding scheme for a copyright notice.
  3. M

    decode/encode

    What's the source? What do you get if you keep decoding & inflating the data?
  4. M

    Could not select database. No database selected issue

    Start with the X10 wiki article on MySQL connection errors. The mysql extension is outdated and twice supplanted. You should be using PDO. Among other reasons, it supports prepared statements. When asking for help with an error, always give the exact error message. Make sure you follow the...
  5. M

    Best FTP Software

    "Best" isn't very meaningful. What's best for one person is sub-optimal for another. What are your requirements? What's your platform? Also, you don't upload files to cPanel. cPanel isn't a file storage mechanism, it's a website configuration panel, with its own method of uploading and...
  6. M

    Embeding videos in user submission site

    strip_tags takes an optional tag whitelist, but don't be tempted. strip_tags doesn't validate the HTML, nor does it let you strip attributes. The former means a malicious poster (or messy writer) can mess up you page structure. The latter opens up your site to injection. You can't parse HTML...
  7. M

    PHP, Jquery and cookies

    @descalzo: it's mostly because bitsets are cool. Point taken about JS's inefficient handling of integer values, though (in practice) it shouldn't be noticeable for the original problem. Since set operations happen so infrequently (only 1 bit would change with each click), the inefficiency won't...
  8. M

    PHP, Jquery and cookies

    Bitset! Assuming there are at most 32 tabs (just watch for sign issues with the MSB), the set could be stored in an integer value.
  9. M

    PHP Table

    Don't use SELECT *; select only the columns you need. When paired with the numeric fetch mode it's particularly problematic, as changing the table structure will wreck the result processing. "text" is the default input type; there's no need to specify it. A definition list seems more...
  10. M

    How do I use multiple joins? - PHP

    One approach would be to use a (left or right) outer join on the `user_items` table against each of the columns in `user_equipped_items` and include only those that are NULL for all three joins. SELECT i.item_name, i.item_type, i.item_cost, i.item_sell_value FROM items AS i JOIN...
  11. M

    Java Scripts

    When it comes to bit twiddling, Sean Eron Anderson's collection of bit twiddling hacks is more enlightening. There's the classics, such as swapping two bit fields without using a temporary, and the classics, such as bit counting. Here's one way of computing the floor of the base-2 logarithm...
  12. M

    jquery UI & jQuery

    What does the error console say? "It suddenly stops working" tells us almost nothing. When asking for help, describe what you expect to happen and what actually happens, including any error messages. Did you include the jQuery UI script? Does it have the Button widget?
  13. M

    Java Scripts

    You don't really need to write a function to convert a number to hexadecimal. Number.toString will do that for you. The disco script should be placed within an anonymous function so the global namespace isn't polluted. Functions are first class data. Rather than having two branches in disco...
  14. M

    please help me.. im a newbie

    Note that the information is available in the X10 wiki MySQL connection information article.
  15. M

    PHP + cURL - Post & Cookies

    Start with the documentation for curl_setopt, which lists the options you should set. You can use curl_setopt_array rather than curl_setopt to set multiple options simultaneously, but the documentation for the latter is what you need to read.
  16. M

    PHP & MySQL - LEFT JOIN issue

    Did you color the sample code by hand? You don't need to do this; just use [php], [html], [code] or [c] (for inline code) tags as appropriate, which will also preserve formatting and better delineate the code.
  17. M

    PHP Login

    Don't threadjack. Start your own thread. Search first. There's plenty on these forums and the web at large to get you started with PDO.
  18. M

    php - mysql error Fatal error: Access denied for user 'root'@'localhost'

    In addition to descalzo's comments: If the remote host you refer to is an X10 server, see also the X10 wiki article on MySQL connection errors. That's obviously not the code, as the error message refers to the user "DANI@localhost", whereas the username in the code sample is "root", which...
  19. M

    PHP Login

    This error message is spot on: there is no PDO::execute(), only a PDOStatement::execute. You're calling execute on the database connection object, rather than the prepared statement. Again, [code] is an inappropriate tag. Error messages aren't code.
  20. M

    Programming Help Rules and Guidelines

    Essellar is also one to heed. He's as (if not more) knowledgable, and more experienced.
Top