Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. unset($_POST['submit']);
  2. Like this? $numbers = array(); for ($i = 0; $i < 12; ++$i) { $number = mt_rand(1, 45); // mt_rand() is approximately four times faster than rand() if (!in_array($number, $numbers)) { $numbers[] = $number; } else { --$i; } }
  3. This should do it. if (date('N') == 5 && date('H') >= 21 || date('N') == 6 && date('H') <= 1) { echo 'Listen Now'; } else { echo 'Listen 9pm - 1am Every Friday Night'; }
  4. Another literal "lol"
  5. Yeah he put it together the other way around though. That's why it doesn't work.
  6. It will if you run them after each other. The first one makes already makes sure that <p> 9</p> will not exist anywhere, but it will be <p>9</p>.
  7. No offense, but how is that piece of information relevant to the matter at hand?
  8. http://dev.mysql.com/doc/refman/5.1/en/select.html The WHERE clause comes before the ORDER BY clause.
  9. http://www.phpfreaks.com/tutorial/basic-pagination You sure seem to need a lot of things ASAP. Maybe you should pay someone if you're in such a hurry.
  10. Try this: ... ORDER BY MONTH(user_birthdate), DAY(user_birthdate);
  11. I assume you are talking about in a URL? Try urlencode.
  12. Cool story. Thanks for letting us know.
  13. http://ispconfig.org/documentation.htm
  14. $string = preg_replace('#<p>\s*(.*?)\s*</p>#i', '<p>$1</p>', $string); $string = preg_replace('#<p>\d+</p>#', '', $string);
  15. I've got a VPS. A dedicated server would be overkill for my needs.
  16. That's quite a surprise to me. As I said, it is something I would expect from any web host. Then again, I've never purchased shared hosting.
  17. I would expect all webhosts to have that.
  18. That doesn't necessarily mean you cannot write a TDD primer.
  19. What do you mean with "doing .htaccess on a folder"? .htaccess files just contain Apache configuration directives. Not only does it have nothing to do with PHP whatsoever, but it can all be looked up in the Apache documentation.
  20. Here is yet another alternative: http://devzone.zend.com/article/4571-Fetching-multiple-random-rows-from-a-database
  21. A sub query returns a result, like all queries do, and you can use that result as a variable in your query. That's it, essentially.
  22. http://web.archive.org/web/20080209154336/http://www.phpit.net/article/simple-mvc-php5/
  23. A login script is essentially so simple that it's not even worth dedicating a tutorial for that. Stuff involved is essentially form processing, database access and sessions/cookies. We have a tutorial for sessions and cookies and we have one for database access and another one focusing on joins and unions. Then you have form processing, but that's fairly straightforward. You simply read from the $_GET or $_POST superglobal. You might also be interested in this blog post that talks about breaking a script/application down into logical elements the same way I just did.
  24. You mean like this? http://www.phpfreaks.com/tutorial/debugging-a-beginners-guide
  25. Please do not post links to download copyrighted material that you do not have the right to redistribute yourself.
×
×
  • 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.