
Alex
Staff Alumni-
Posts
2,467 -
Joined
-
Last visited
Everything posted by Alex
-
How to validate the size of an image before the Upload?
Alex replied to lopes_andre's topic in PHP Coding Help
getimagesize -
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.
-
1. You're still using mysql_db_query() there. 2. You're naming only 2 columns and providing 3 values.
-
The entire jQuery framework is only about 24KB (when compressed).
-
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.
-
foreach($arr as &$val) { if(substr($val, 0, 1) == "+" || substr($val, 0, 1) == "@") { $val = substr($val, 1); } }
-
If it works what kind of thought are you looking for?
-
http://www.roscripts.com/Pretty_URLs_-_a_guide_to_URL_rewriting-168.html
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=308166.0
-
The profile() method would have to return an object that has a public property named weirdname.
-
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.
-
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); } }
-
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.
-
You would have to do something like this: class Parsers { public $Imdb; function __construct() { $this->Imdb = new Parsers_Imdb_Imdb; } }
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=308051.0
-
You're missing the point of PHP. This is something for CSS.
-
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.
-
Use break; to break out of a loop. foreach(...) { if(...) { break; } }
-
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?
-
URGENT - Server has locked my index file for overloading mySQL!
Alex replied to hedgehog90's topic in MySQL Help
For more alternatives to ORDER BY RAND() see this post. -
Looking for modern user interface to gather data
Alex replied to cunoodle2's topic in Javascript Help
http://jqueryui.com/demos/slider/#steps -
This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=307735.0
-
This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=307532.0
-
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.
-
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.