-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
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']);
-
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>
-
http://www.google.co.uk/search?q=prototype+load+jquery+equivalent
-
How are you determining the rows returned, could you show the code?
-
I imagine you don't quite have the expected value for "C. & G" you think. What does a var_dump on the variable return?
-
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.
-
Display info from database, grouped by field
Adam replied to furiousweebee's topic in PHP Coding Help
Ah, fair enough then. No problem. -
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']))
-
Display info from database, grouped by field
Adam replied to furiousweebee's topic in PHP Coding Help
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! | +--------------+---------------------------------------------------+ -
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) {
-
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.
-
How can i get this to load faster?? using jquery
Adam replied to geekisthenewsexy's topic in Javascript Help
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? -
using a calendar script, how to prevent old date selected
Adam replied to jasonc's topic in Javascript Help
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. -
It's not clear how your data is structured. Could you print_r() the $_GET array and copy/paste (from the source) the output?
-
Could you show the mark-up for the button?
-
load() loads an XML file. You need to use loadXML() to load from a string.
-
How are you naming the check boxes?
-
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]; }
-
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.
-
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.
-
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 />'; }
-
Could be a million things. I'd contact SecureNet to be honest..