Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Of course. It's still a benefit even if it's morally questionable. I never said I condoned any such behavior though.
  2. 1) Makes it harder for spammers. 2) You have a way of contacting them. 3) You can use it when they need to reset their password. 4) You can sell it to spammers for $$$.
  3. If you're using PHP 5.3: $timestamp = new DateTime('05:00'); $diff = $timestamp->diff(new DateTime()); echo $diff->format('%h hours, %i minutes'); See: http://php.net/datetime.diff http://php.net/dateinterval.format
  4. This topic has been moved to Staff Cafe. http://www.phpfreaks.com/forums/index.php?topic=307240.0
  5. Google decides entirely for itself which links it will display there based on what it finds most important/relevant.
  6. Congratulations. You almost discovered merge sort. If you have two sorted lists, you can combine them to one sorted list in linear time, so there is no need for the sort in #5. With that change you now have merge sort, or more specifically, parallel merge sort which has almost a linear speedup. With that said, it will be slower and more memory intensive fetching all the values and then sorting them in PHP. Your DBMS already has highly optimized sorting algorithms implemented, and seeing as it has to touch all the resulting rows anyways, it will be faster just doing the sort while it's at it.
  7. Have you considered it might be a good idea looking at the error message you get from PDO instead of throwing it away?
  8. On GET/POST data, PHP considers things in [] to be array indices.
  9. That's fine. Just remember that you might run into trouble if you're writing code that other people are going to use seeing as they're turned off by default.
  10. Are you seriously calling those "cool features"? It's just marketing BS. If you're the only user (which you are on a VPS), there is no reason why you shouldn't have those...
  11. Not very much. Most of what is served is text. So far this year we've used about 567 GB on HTTP traffic according to awstats.
  12. I'd go with IP.Board if you're willing to pay. If you're not, then I have no recommendations.
  13. Daniel0

    project

    What degree? What kind of courses have you taken? What have you learned?
  14. I beg to differ. SMF's SSI.php hijacks the sessions, global namespace and the superglobals. You can write your website based on it, but integrating it with something existing would be difficult.
  15. Any reason why a VPS couldn't suit your needs? Linode has got a plan that gives you 1 GB memory and 32 GB disk space for $39.95/month (£25.02).
  16. You'll need a dedicated server or a VPS. No shared host is going configure their web servers to listen on multiple ports for individual customers.
  17. From the board description:
  18. They loaded fine for me before. Now they don't.
  19. Oh come on. We want pictures in this topic
  20. Why are you using number_format() and printf() at the same time?
  21. Why don't you just install a packet sniffer and have a look?
  22. If you have a problem with Pikachu2000, why not take it up with him personally instead of involving the staff?
  23. The web server doesn't receive any email. That would be the MTA (mail transfer agent). Many Linux based MTAs use the /etc/aliases file to specify where the emails should be routed to. By default it's a user on the file system, but it's also possible piping it to STDIN on a script. This line would send email to something@example.com to to the user daniel: something: daniel This line would send email to something@example.com to a script called parse.php: something: "| /usr/local/bin/parse.php" In parse.php you can then use the I/O streams to read the email from STDIN. The input format is the usual email format, i.e. first the headers, then a blank line and then the body. That should be trivial enough to parse.
  24. Do you have any particular example? I've looked at some of your questions, and it's not like all of them are extremely clear. Some of them take a few posts before we get to figure out what the actual problem is. Some of them have huge chunks of code, which is something that will make many people just ignore you (especially when you haven't even bothered formatting your post with tags). Many times, if a question is well-written, it will also receive good responses. Have you read "How To Ask Questions The Smart Way" by Eric Raymond?
  25. function selectFromLastDays($num = 4) { // implementation left as an exercise for the reader }
×
×
  • 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.