Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. You have to either escape the double quotes in the string you're trying to echo, or use single quotes with the echo instead. The latter is easier: echo '<img src="icons/Doors.png" width="32" height="32" border="0">'; I also suggest that you don't use short tags because it will just cause you headaches in the future.
  2. 1. You're still using mysql_db_query() there. 2. You're naming only 2 columns and providing 3 values.
  3. The entire jQuery framework is only about 24KB (when compressed).
  4. All the else statements that don't have braces that I see should work fine because you're only executing one statement on that condition, so I think your problem is somewhere else. Personally, even if I only need to execute a single statement on a certain condition I opt to leave the braces there. I find that it makes things look a lot neater.
  5. Alex

    Array

    foreach($arr as &$val) { if(substr($val, 0, 1) == "+" || substr($val, 0, 1) == "@") { $val = substr($val, 1); } }
  6. If it works what kind of thought are you looking for?
  7. Alex

    $_GET

    http://www.roscripts.com/Pretty_URLs_-_a_guide_to_URL_rewriting-168.html
  8. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=308166.0
  9. The profile() method would have to return an object that has a public property named weirdname.
  10. I realize that my first solution wasn't the best because it wouldn't turn Z into A. Here's a better solution: for($i = 0, $n = strlen($text);$i < $n;++$i) { $val = ord($text[$i]); if($val > 64 && $val < 91) { $text[$i] = chr((($val - 64) % 26) + 65); } else if($val > 96 && $val < 123) { $text[$i] = chr((($val - 96) % 26) + 97); } } You could probably even shorten that, but in terms of readability that's more clear.
  11. Here's one way to do it: for($i = 0, $n = strlen($text);$i < $n;++$i) { $val = ord($text[$i]); if($val > 64 && $val < 122) { $text[$i] = chr($val + 1); } }
  12. Alex

    $_GET

    What you want is mod_rewrite and pretty URLs. Just Google it and you'll find plenty of results with examples on how to implement it.
  13. You would have to do something like this: class Parsers { public $Imdb; function __construct() { $this->Imdb = new Parsers_Imdb_Imdb; } }
  14. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=308051.0
  15. You're missing the point of PHP. This is something for CSS.
  16. You have nested foreach loops or what? Just make sure that the variable you're performing the foreach on is an array using is_array.
  17. Use break; to break out of a loop. foreach(...) { if(...) { break; } }
  18. You're not even using $msg in the function, so why are you passing in that parameter? Just remove it. function siteonline(){ siteonline(); I doubt that's your problem though. More likely than not it's just throwing an undefined constant warning and assuming string "n". Are you sure that $offline contains what you're expecting?
  19. For more alternatives to ORDER BY RAND() see this post.
  20. http://jqueryui.com/demos/slider/#steps
  21. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=307735.0
  22. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=307532.0
  23. Try: if (document.getElementById('plus').style.background=="url('/images/minus.png')"){ document.getElementById('plus').style.background="url('/images/plus.png')"; } else { document.getElementById('plus').style.background="url('/images/minus.png')"; } If you're gonna use single quotes inside single quotes you need to escape them. In this case it's just easier to use double quotes. For future reference when posting code you should use [php] or [code] tags.
  24. I haven't experienced this myself. Adobe Flash 10.1 actually introduced some features that was suppose to reduce memory and CPU usage. They did things like throttle the frame rate to 2 FPS and timers to 2 seconds while the flash app is in a hidden tab. This actually did a great job reducing CPU and memory usage, but there was no way to disable it making it completely backwards incompatible. Adobe screwing over developers... again.
×
×
  • 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.