Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Or just configure .css files to be handled by PHP. What is this post for anyway?
  2. Heh... if I find a good name then I'll register it. I won't tell everybody else so they can monetize instead of me.
  3. You need to look harder: http://pecl.php.net/package/dio
  4. Duh... well, isn't it pretty stupid ordering for less than the shipping costs? Buy in larger quantities or, if it's for so low value, go buy it in a nearby store.
  5. http://lifehacker.com/5064117/a-hands+on-first-look-at-google-android
  6. They can also change IP, user agent, create new accounts, etc.
  7. The difference is the logic flow: while: 1) Is condition true? 2) If yes, execute block and start over. If no, terminate loop do-while: 1) Execute block 2) If condition is true, start over. Otherwise terminate loop.
  8. The reason is that you are calling the header() function after anything has been outputted. A quick fix would be to put ob_start() on the top and ob_end_flush() on the bottom, but that's not a good solution. It's a design flaw in your application and you should rather rewrite it to now output anything before you're done.' Also (and this is unrelated to your specific problem), I'm quite sure you can work out a better solution than those huge switches you have Hint: You're doing practically the same with all the things, how about using a loop?
  9. Ooops... sorry. My bad. Switch the order and the limit around, i.e.: SELECT * FROM fish WHERE areacaught = 1 AND rodused = 1 ORDER BY RAND() LIMIT 1; PS: You can just copy and paste the errors, it's easier
  10. The safest would be to store them outside the document root and only serve them dynamically through a script like in the link I posted. If you use readfile() then it'll echo the contents of the file and not execute it. In that case you'll be safe. If the uploaded file lies within the document root, however, then you risk that people will find and execute the file. E.g. if http://example.com/index.php is at /var/www/example.com/htdocs/index.php then your uploaded files could go into the folder /var/www/example.com/uploads. In that way they won't be directly accessible. Generally, everything that should not be directly accessible should not be within document root.
  11. You can use a query like this: SELECT * FROM fish WHERE areacaught = 1 AND rodused = 1 LIMIT 1 ORDER BY RAND();
  12. You can just use an array: $_SESSION['cart'] = array( 'productID' => $productID, 'styleID' => $styleID, 'quantity' => $quantity, );
  13. Ah I see... I thought you wanted the user to upload without using a PHP backend. You're doing it correctly (at least with the headers). You don't have to modify the users' files though. You can just have e.g. download.php with your above snippet and then use readfile() to include and send the file. See this post for instance: http://www.phpfreaks.com/forums/index.php/topic,95433.0.html
  14. Better off letting Apache handle it: RewriteEngine on RewriteCond {%HTTPS} !on Rewriterule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L] Put that in your httpd.conf in a <Location> block or put in in a .htaccess file.
  15. There has to be some sort of backend handling the upload. I'm not quite sure what you're trying to accomplish.
  16. I think you find that it "screams football" because the image displayed is of football players. If you look more closely then you'll see that it cycles through four images. The three other images are of students it seems.
  17. It's been there for a long time. It's just been renamed from "Application Design/Layout (No coding help)" to "Application Design" and moved. This happened during the reorganization.
  18. It's just the default Gentoo config file: http://daniel0.net/my.cnf I don't understand why it uses so much memory. On my Vista laptop mysqld-nt.exe takes up about 1 MB RAM (InnoDB enabled). On my Gentoo VPS it uses 31 MB (InnoDB disabled).
  19. Maybe it's just because I don't know what happens behind the scenes, but I just don't understand how it can spend 120 MB RAM doing absolutely nothing. As of right now there aren't even any InnoDB tables on the server. It's just the difference between enabling its usage or not.
  20. Oh... must be because you haven't got permission to view it. I just thought people could seeing as its visibility is set to "Visible - Except in group key". Nevertheless, the group does exist
  21. One final addition could be the usage of fluent interfaces for methods that do not return a value so you'll be able to do something like this: $obj = new Foo(); $foo->doSomething() ->doSomethingElse(); It just looks nicer. You'll make a method able to do this by returning $this. It's just a nice little addition, but in no way required. It saves you from typing the name of the variable each time if you need the object to perform a lot of operations after each other and neither of those return any value.
  22. Looks good, Jeff. The only thing I can think about is giving the username and password field (which I assume they are) background images saying respectively "username" and "password" and switch to the regular background when activated. Just for accessibility and such. It looks a bit strange to just have to form fields and a button with no visual aid about their meaning.
  23. Your background image is way too big (in KiB). Seeing as it repeats horizontally you could just have a 1px wide image. It'll result in the same, but the file size would be way smaller. The bottom corners look a bit weird. I'd probably also have some sort of hover effect for the navigation bar to give feedback to users. Probably a different font as well. You could easily replace the text with an image to have nicer looking fonts, but still be accessible to all users. You could also work a bit on the forms. Give them some custom styling while still preserving their form-ness. Use <label>s for checkboxes and place the label after the checkbox, not before. In this way you'll have the checkboxes aligned nicely. I'd also place the "required asterisk" after the field label (again, use <label>s). This is for alignment reasons as well. You should also make all fields/textareas of equal width and vertically, where it applies, I'd align the labels to the top instead of the middle of the field as well as probably make them bold. Also, your title doesn't change at all. It should... Oh yeah, drop the splash page as well. It's annoying.
  24. Just because it works doesn't mean it's correct. The ico file has no information about whether it was "originally" a GIF file.
  25. You could do that, but I was thinking of something more like this: class Pagination { static private $defaultConfig = array(); private $config = array(); public function __construct() { $this->config = self::$defaultConfig; } static public function setDefaultConfig(array $config) { self::$defaultConfig = $config; } public function setConfig(array $config) { foreach ($config as $key => $value) { $this->config[$key] = $value; } return $this; } public function getConfig($key = null) { if (!is_null($key) && isset($this->config[$key])) { return $this->config[$key]; } return $this->config; } // etc. } Pagination::setDefaultConfig(array('foo' => 'bar', 'Daniel' => 'cool')); $paginationOne = new Pagination(); // this one has the default config $paginationTwo = new Pagination(); // so does this one... for now... $pagination->setConfig(array('foo' => '123')); // ... but we changed a bit here So you have a default setter and a specific setter and getter for the configuration data.
×
×
  • 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.