Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. The lowest I could get a 1x1px image was 43 bytes. I did a quick test and both file uploads and GD manipulation work fine.
  2. It does, because it crashes one of the functions in my script. I think its a GD issue. Can't remember which one, but it is a know issue, so I added in that code last January. That's not how you fix bugs. And how would you fix it? I would figure out what the problem is and then find a solution. Too high for what? The minimum limit is too high. It is not unreasonable for a small profile picture/thumbnail to be <4KB. Your profile picture is under 3KB.
  3. It does, because it crashes one of the functions in my script. I think its a GD issue. Can't remember which one, but it is a know issue, so I added in that code last January. That's not how you fix bugs. And 4KB is still way too high.
  4. I think it just limits further "prettification" of URL's, because you can't use routing. For example say you want to display a news page. Let's say the URL is example.com/news. What if you introduce pagination? You would have to do something like example.com/news/page/1, where "news" is the controller and "page" is a method. You'll probably either have a hacky-looking workaround or code duplication too, since you are displaying essentially the same thing for the "page" method as you would the default method. Using routing you can easily route example.com/news/page/1 or just example.com/news/1 to the default method. That's just a quick example, but I use the routing features of CodeIgniter and FuelPHP all the time.
  5. I don't think a minimum size makes any sense, especially not 4KB. Your profile picture is only 2.57KB. I think somewhere in the neighborhood of 100-150KB for 90X90px images should be acceptable.
  6. So did you try that?
  7. require_once(dirname(__FILE__)."/pay_paypal.loadframework.php"); require_once(JPATH_ADMINISTRATOR.'/components/com_adsman/tables/addsman.php'); require_once(JPATH_ADMINISTRATOR.'/components/com_adsman/tables/adsuser.php'); require_once(dirname(__FILE__)."/pay_paypal.php");
  8. What is the error?
  9. It doesn't have to be in pay_paypal.notify.php, it can be in any of the other 4 files you are including.
  10. Oh, my bad. I see the problem. You'll need to reset $asciiString for each iteration. So put $asciiString = ""; inside the foreach loop.
  11. I think you are looking at the (edit: wrong) file. You are trying to include import.php from framework.php. I don't know what this has to do with the files you mentioned.
  12. You can try stripslashes. Or don't use slashes as the delimiter and then you don't have to escape them. But all you have to do is change a "1" to a "0" and the problem goes away. Don't make it harder than it has to be.
  13. I think I got it working with this: $words = array('TEstABcDE12345678910', 'TeshgaGDasf#1345'); $ascii = ''; foreach($words as $word) { $index = 0; while($index < strlen($word)) { $ascii .= ord($word[$index]); $index++; } echo $ascii . '<br />'; } However as an XSS prevention technique, I have my doubts. In my opinion, either use htmlentities() or htmlspecialchars() if you do not want to preserve HTML, or use HTML Purifier if you do want to preserve HTML.
  14. If they are in the same directory you don't need to supply a path, just give the file name. require_once 'pay_paypal.loadframework.php';
  15. Where is the script calling the require located?
  16. You probably have magic quotes turned on. Turn it off in the php.ini.
  17. I think what you are experiencing is a Byte Order Mark or BOM. What character encoding does the file use?
  18. https://www.google.com/search?q=php+pretty+urls&ie=utf-8&oe=utf-8&aq=t
  19. What code should go in your download.php file? You should be urldecoding and stripping slashes from the $_GET input.
  20. Are you kidding me? OOP existed a long, long time before PHP even decided to think about implementing it. OOP existed long before PHP existed. PHP 5.3 & 5.4 have added OOP features that have existed in other languages for a long time. PHP is not known for its OOP implementation. In fact, it is rather notorious for lacking simple features that other languages have had forever. For example, PHP only just added namespaces 3 years ago in the 5.3.0 release. And, it's still crappy and not as good as other languages that use namespaces.
  21. I usually use switch when I have more than 2 cases. I think it is more of a preference thing and what you think is easier to read. I've seen some benchmarks where switch is faster and I've seen some where if/else is faster. This tells me there isn't a huge performance difference, so use whatever you like more.
  22. It really depends how the function is used and what depends on it. I don't think the error handling should be done in the function though. What if you wanted to use the function for something else but wanted to handle the failure differently? For example in one part of your script it may be required to return a value but somewhere else it may not be a big deal.
  23. So to be clear, we are talking about sha1_file() and not sha1()? The only way I can think sha1_file() would return false is if the file does not exist. As you'll notice, sha1() doesn't return false on failure because it can't fail.
  24. I don't think the function should be responsible for terminating the application. I think the function should simply return something and that's it. How you handle what is returned should be done in the application itself.
×
×
  • 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.