Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Of course. It's still a benefit even if it's morally questionable. I never said I condoned any such behavior though.
-
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 $$$.
-
Converting timestamp to a "xx hours xx minutes ago" format, my take
Daniel0 replied to sw0o0sh's topic in PHP Coding Help
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 -
This topic has been moved to Staff Cafe. http://www.phpfreaks.com/forums/index.php?topic=307240.0
-
Google decides entirely for itself which links it will display there based on what it finds most important/relevant.
-
Help To Extremely Optimize Multidimensional Array Sort
Daniel0 replied to JustinK101's topic in PHP Coding Help
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. -
Have you considered it might be a good idea looking at the error message you get from PDO instead of throwing it away?
-
On GET/POST data, PHP considers things in [] to be array indices.
-
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.
-
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...
-
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.
-
I'd go with IP.Board if you're willing to pay. If you're not, then I have no recommendations.
-
What degree? What kind of courses have you taken? What have you learned?
-
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.
-
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).
-
How to make my website run on a non-standard port?
Daniel0 replied to kevk3v's topic in Apache HTTP Server
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. -
From the board description:
-
They loaded fine for me before. Now they don't.
-
Oh come on. We want pictures in this topic
-
Why are you using number_format() and printf() at the same time?
-
Why don't you just install a packet sniffer and have a look?
-
If you have a problem with Pikachu2000, why not take it up with him personally instead of involving the staff?
-
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.
-
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?
-
function selectFromLastDays($num = 4) { // implementation left as an exercise for the reader }