Jump to content

Ken2k7

Members
  • Posts

    5,196
  • Joined

  • Last visited

    Never

Everything posted by Ken2k7

  1. Code behaves differently when it's incorrectly written. The fact it works doesn't mean it's correct. So no, I don't know. As for the color palette, I'm sure you can add more to it. I haven't looked through your mess to say how though. Post up the relevant bits.
  2. Add single quotes to onclick="showPalette('palette')" Also, add a check. function showPalette(Click_Menu) { Click_Menu = document.getElementById(Click_Menu); if (!Click_Menu || !Click_Menu.style) return; if (Click_Menu.style.display == "none") { Click_Menu.style.display = "block"; } else { Click_Menu.style.display = "none"; } }
  3. Okay, a few things: $csql1="UPDATE 'games' SET counter = '$counter' WHERE gid = '$gid'"; Don't put single quote around games. It's a table name, not a string. $counter=$ccolumn['counter']; $ccolumn is not defined. Also, your code is redundant. Just run: mysql_query("UPDATE games SET counter = counter + 1 WHERE gid = '$gid';") or trigger_error(mysql_error()); No need for all the checks. That will add 1 to counter.
  4. Oh, use this: buildPopup_HtmlCode(390, 329, '<img src="' + html_code + '" alt="" />', '<a href="http://www.amateurmatch.com/in/?ainfo=MjI5MjR8Nnw3NDc=&atcc=0&_t=search3&id=489257" target="_blank">' + html_code + '</a>);
  5. If you're using C#, then just add an OnClick otherwise, you need AJAX.
  6. Hmm... no idea. I sure hope you don't think we're psychic because I hate to disappoint you. Please post up the relevant code snippets.
  7. Find out for yourself. Match everything between [one] and [/one] $str = 'test [one]test[/one] test [one] test test [/one] test';
  8. What difference would that make? You can easily add a new column called "ordering" if you want to order them in a particular order. You can still do it using UNION. Just select the first 2 in descending order, then UNION it with the rest ordered by descending.
  9. I didn't think that was the issue. I was denoting that there is a difference between (.*?) and (.*)? and people usually blindly mis-use them because as evident, you think they're the same thing. So write better regexp and don't rely on .*.
  10. What does that function return? Also, what's $poll? And please do not use PHP short tags.
  11. Use an if statement? Or a ternary?
  12. Why not check in the SQL? $users_result = sprintf("SELECT userId FROM persinfo WHERE cat_id = 1 AND userId = '%s';", mysql_real_escape_string($in_userId));
  13. That is just a bad idea. Use an array or something. But if you must, ${"var".$variable}.
  14. $x = sizeof($arr); while(--$x > 0) echo $arr[$x];
  15. I just took a glance and didn't bother reading all of it. But what exactly is not working. Because that really doesn't make sense. Does it do nothing or something undesired?
  16. You really should use (.*?) carefully. Surely you can use something other than that. It's just too vague. Change it to (.*)? I'm not saying that is any better lol.
  17. Ken2k7

    regex help

    Try this Replace: '/(^\
  18. Usually when you need to count up a set.
  19. You should add an alt attribute to img.
  20. Again, please do not post any code that are not relevant to the problem, like that PHP class file. If I haven't helped you earlier, I would have no idea what that class does or why you posted it. It doesn't help us help you if you post up more code that are not of any relevance. You shouldn't have JavaScript be a validation to get into a page. It just doesn't work, period.
  21. Do you need GROUP BY then? Why not just ORDER BY groupname DESC, mydate DESC, lastname DESC?
  22. You can store the values in an array like this: $a = array( 'product1' => array( 'price' => '5.50', 'shipping' => '10.40' ), 'product2' => array( 'price' => '10.00', 'shipping' => '.10' ), ... ); // keeps track of the total price $price = 0; // keeps track of the total shipping $shipping = 0; // then loop foreach ($a as $key => $value) { $price += $value['price']; $shipping += $value['shipping']; } echo sprintf("Price: %s<br />Shipping: %s<br />", $price, $shipping);
  23. Doesn't make sense because for one, CURRENT_DATE() should be already be greater than last_voted, so adding 12 hours to it doesn't do anything. I think you want to subtract or add 12 hours to last_voted. But your logic is off.
×
×
  • 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.