Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
The mb_ functions are for for multi-byte character sets like UTF-8. See: http://www.joelonsoftware.com/articles/Unicode.html
-
I think perhaps you've misunderstood what a forum is
-
Maybe if you posted the generated query along with the error message, people could better help you.
-
Well, that's not how array_push() works. What you're looking for is: $_POST['DOB'] = $_POST['Day']."-".$_POST['Month']."-".$_POST['Year'];
-
In that case you can do something like this (assuming $source holds the HTML source code of that page): preg_match('#<body[^>]+bgcolor=[\'"]([#a-z0-9]+)[\'"][^>]*>#i', $source, $matches); $color = $matches[1]; Not tested.
-
That depends on if you have indexes on the fields you are selecting by.
-
You can easily abstract yourself out of that problem.
-
Show all posts since last visit.
Daniel0 replied to salathe's topic in PHPFreaks.com Website Feedback
Especially if you're a staff member and want to make an administrative note, but are otherwise not interested in following the discussion going on in the topic. -
Assuming that array is in $date: $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); if ($timestamp + 30*60 <= time()) { echo 'At least thirty minutes have passed.'; }
-
Actually that's in no way straightforward. There are a number of ways in which the background color may be set. You'd have to consider the bgcolor attribute on the body tag. You'd also have to consider CSS and the way selectors are given weight according to the CSS specification as well as the fact that numerous stylesheets may have conflicting information, and in that case you'll have to figure out which one should be the correct one.
-
In what sense? I can tell you the "or die(mysql_error())" is not correct in any way though
-
Just combine them into a single index before looping and remove the other ones. For cleanliness, create a copy of $_POST for this purpose so you don't pollute it.
-
No, you're not. You're both limiting the results using WHERE and LIMIT. I'm not sure I entirely understand your question though.
-
For what purpose? Outputting text? If that's the case then no, it's controlled by a php.ini setting called default_charset.
-
You could write a service that runs in the background and analyzes the access log. Not exactly a simple solution. Easiest thing would be to have a counter using sessions that blocks if they've made X requests within the last Y time units.
-
Show all posts since last visit.
Daniel0 replied to salathe's topic in PHPFreaks.com Website Feedback
Unfortunately, the software we are using is lacking proper ways of tracking topics (in my opinion). There is "Show new replies to your posts", but that only does what it says. It also doesn't allow you to remove topics you are no longer interested in, and it doesn't show topics that don't have new replies. That is more or less the same with "Show unread posts since last visit". What I miss is a feature that allows you to subscribe to a topic (with or without email notifications) and have a kind of custom topic listing that shows these. Other forums have that, but unfortunately not SMF. We installed a bookmark modification, but it's not exactly ideal either. -
Man... that was supposed to be a secret!
-
I've always been dual booting. Sometimes I'm in Ubuntu, sometimes in Win7.
-
Sure. [attachment deleted by admin]
-
Possible to check integer based string if integer equal to 32 bit
Daniel0 replied to Tuck's topic in PHP Coding Help
Integers in PHP are always 32-bit. -
Divide by 100. That's the definition of percentage; it means "per hundred". If you have 10 percent of something then you have 10 each time you have 100 of that something.
-
Uh... taking a% off b is just (1-(a/100))*b. That's elementary mathematics. It's the same in PHP, just put $ before all variable names. So 10% off 500.75 is 0.9*500.75=450.68
-
That doesn't make sense (the "convert it back to percentage" part). Explain it in math and I'll port it to PHP
-
Unread since last visit...How can I limit to ONE forum?
Daniel0 replied to mrherman's topic in PHPFreaks.com Website Feedback
And then substitute c with boards and give a comma-separated list of board IDs. E.g. http://www.phpfreaks.com/forums/index.php?action=unread;boards=107,34 for "PHP Applications" and "Third Party PHP Scripts"