Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. On this line of your code: if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)){ ..you specify the $target location to move the file; modify $target to contain the file name you want. Currently you have: $target = "../images/"; $target = $target . basename( $_FILES['uploaded']['name']) ; Replace it to something like: $target = "../images/"; $target = $target . md5(rand() . $_FILES['uploaded']['name']);
  2. Not sure how you solved this exactly, but you're better off using a toggle function type solution: function toggleDelete(obj, el) { if (obj.checked == true) { document.getElementById(el).style.backgroundColor = 'red'; } else { document.getElementById(el).style.backgroundColor = 'transparent'; } } You can call it like: <div id="member"> <input type="checkbox" onchange="toggleDelete(this, 'member');" style="padding: /> </div>
  3. http://www.google.co.uk/search?q=prototype+load+jquery+equivalent
  4. How are you determining the rows returned, could you show the code?
  5. I imagine you don't quite have the expected value for "C. & G" you think. What does a var_dump on the variable return?
  6. I would create a kind of 'attributes' table for non-standard details: attr_id | machine_id | attr_name | attr_desc --------------------------------------------------------------- 1 | 1 | Memory | Description of the memory installed 2 | 1 | CPU | Description of the CPU installed Linking to the machine by `machine_id` of course.
  7. No problem
  8. Ah, fair enough then. No problem.
  9. As PFMaBiSmAd suggested, I think an array would be better for something like this: $cnxs = array( 1 => array( 'host' => 'server1', 'user' => 'xxx1', 'password' => 'yyy1', 'dbname' => 'zzz1' ), 2 => array( 'host' => 'server2', 'user' => 'xxx2', 'password' => 'yyy2', 'dbname' => 'zzz2' ) ); $site = 2; if (!$cxnSignIn = mysqli_connect($cnxs[$site]['host'], $cnxs[$site]['user'], $cnxs[$site]['password'], $cnxs[$site]['dbname']))
  10. Can I ask why they're not in the same record? Looks like a bad design to be honest. If only at least for performance I'd recommend merging the two records, but if not you can join 2 records from the same table. It's just a little awkward and unnecessary: select q1.value as name, q2.value as comment from quotes q1, quotes q2 where q1.quoteid = q2.quoteid and q1.name='author' and q2.name = 'content'; Returns: mysql> select q1.value as name, q2.value as comment from quotes q1, quotes q2 where q1.quoteid = q2.quoteid and q1.name='author' and q2.name = 'content'; +--------------+---------------------------------------------------+ | name | comment | +--------------+---------------------------------------------------+ | John Jackson | You guys are great! Thanks for being awesome. | | Peter Davis | Gosh you're amazing! Always been so darn helpful! | +--------------+---------------------------------------------------+
  11. eregi is deprecated, you should use preg_match with the 'i' modifier instead. If you're only wanting to check if the string exists in the referrer though, you should just use stripos: if (stripos($r, $sto) !== false) {
  12. That's because you're using fetch_array(). If you wish to return only the associative array use fetch_assoc(), or for the numeric array use fetch_row() .. That's assuming of course the DB class you're using has those methods.
  13. I'm not too sure with IE if you can monitor the headers, but if the problem exists in FF as well can you not just use Live HTTP Headers?
  14. Within the "db_onclick()" function, you have the d, m and y parameters containing the selected date, and a global date object called ds_i_date you can use to get the current d, m and y. Using those you should be able to validate the date isn't before the current date.
  15. It's not clear how your data is structured. Could you print_r() the $_GET array and copy/paste (from the source) the output?
  16. Could you show the mark-up for the button?
  17. load() loads an XML file. You need to use loadXML() to load from a string.
  18. How are you naming the check boxes?
  19. The best way to do this really varies on the rules for the discounts. Does it have to be strictly 5, or it can be more? Assuming it can be 5 or more, and you want to easily add/remove more discounts, a possible solution: //var total = ... (assume this has the total check boxes checked) var discounts = {5:2, 10:4, 20:8} var discount = 0; for (var requirement in discounts) { if (total < requirement) { break; } discount = discounts[requirement]; }
  20. Adam

    phpGolf

    I see. Well it's a neat idea, I'm sure it'll addict a few people! I'd make it all more social though. Give each user a profile, set-up community forums, etc. No one can "brag" about their low bytage to each other at the moment.
  21. Adam

    phpGolf

    Perhaps after a submission you can see other people's code? Better learning experience. I'd also like to know what you mean by "bytes" exactly. Is that the memory used by the system, the size of the file, etc. ? The "newline won't count" rule threw me a bit.
  22. Still, same question applies. If you want to know how to count 'external link' clicks, you need to specify how you determine an external link from an internal one within your DB table.
  23. Well, what is your current method of determining an internal link from an external one? Or at least, what is the theory behind it?
  24. Edit: oh yeah it will $url = 'http://mobsters-fb-apache-dynamic-lb.playdom.com/mob_fb/get_hit_list?user_id=100000952273457&target_id=100000556624340&level=300&auth_key=cb07c7575b38df48d82dd53619385faa884db5a2'; $xml = new SimpleXMLElement($url, null, true); foreach ($xml->xpath('/outer/xml/entry[amount > 4100000000]') as $entry) { echo 'Targeted user: ' . $entry->target_user->user_id . '<br />'; }
  25. Could be a million things. I'd contact SecureNet to be honest..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.