Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Atoms aren't infinitely small though. Try going back a couple of hundred years and try telling someone that in the future we'll have flying machines that can take us anywhere in the world in short amounts of time. Or try going back only 30 years and try telling someone that today, even children have computers, you can get some that only weigh a couple of kilograms but are still several orders of magnitudes more powerful than theirs and that 4 GB RAM is really cheap. That's not to say I think we'll have the technology soon, within my lifetime or even within a couple of hundred years. For all I know, someone might make an ingenious discovery in a couple of decades that changes life as we know it. The hard limit you're speaking of is the hard limit imposed by current technology and scientific theories. It's really difficult speaking about what we'll have in the future. If we knew that, it wouldn't belong in the future but today.
-
How are you displaying it? If you view http://www.phpfreaks.com/forums/foo/bar/doesnt-exist.html?test=hello you'll see that REQUEST_URI specifically will be the page the user tried to exist (except this is Apache's default 404 error page, not a custom 403 error page).
-
This: strtotime('+1 week', $_SESSION["PreviousVisit"]) >= time() will always be true because you set $_SESSION["PreviousVisit"] = time(); It's always true that one week in the future is greater than right now when you store the timestamps in Unix format. You need to compare against the time your poll started. This is static. Also, that statement is used to check if the poll is still running. You would want strtotime('+1 week', $startTime) < time() instead to check if it has expired.
-
Yes I can. Read the string character by character. You put every second character in one variable and the others in another variable. Why don't you try it out?
-
The function time can give you a timestamp. It will be fine for this.
-
You can use REQUEST_URI. <?php header('HTTP/1.1 403 Forbidden'); echo 'You cannot access this page: ' . filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_SPECIAL_CHARS); Note that sending the proper response code is actually important.
-
Something like this should do it: <?php $word1 = "ABC"; $word2 = "123"; $res = ''; for ($i = 0, $l1 = strlen($word1), $l2 = strlen($word2); $i < $l2 && $i < $l1; ++$i) { if ($i < $l1) { $res .= $word1[$i]; } if ($i < $l2) { $res .= $word2[$i]; } } echo $res;
-
As long as you somehow store the time it shouldn't be a problem. I would recommend using a real database though. It's way easier managing data if you do that.
-
You would have known if you'd read our rules.
-
It's easy enough if it's a week after the poll creation. How are you storing the poll data, in a database? Just store the timestamp of the creation time along with it. You can then use logic like in my previous post to determine whether or not the poll has expired and thus whether or not the results should be displayed to the user.
-
A week after they voted, or a week after the poll started? If it's after they voted, just store the time they voted in a session as well. If it's after the poll started, just store start time (e.g. using time) and check against that instead. Either way, if we say that you have your timestamp as $start, you can check if one week has passed by doing if (strtotime('+1 week', $start) >= time()). It was just meant as a placeholder for a boolean value determining whether or not the time limit has passed. It was just pseudocode to convey the logic that is required to make it work.
-
Why do you need it to expire? You can just do something like this: if ($expired) { // show results } else if ($hasNotVoted) { // show voting controls } else { // tell the user they've already voted }
-
Given sufficient magnification you would be able to see anything regardless of size. Just because a piece of technology doesn't exist doesn't mean it cannot exist. No such thing exists, so when talking about non-fictitious things it must be implicitly understood that there is a context. Therefore, when someone says "air is invisible" it's logical to assume the person means "to me". Natural languages cannot be correctly interpreted if everything is taken literally.
-
I don't know anyone who walk around with microscopes powerful enough to view things at molecular or atomic level (or just any type of microscope really), so I think it's reasonable to say that air by "default" is invisible.
-
The first thing that I noticed was that it's missing the second T. How do you know it's the second and not the first one that's missing?
-
I actually think IP.Board allows you to have multiple sources of authentication data. A chain of login strategies you might say.
-
I think John's air is probably just heavily polluted.
-
When the content changes often and realtime updates are necessary.
-
Isn't it sort of stupid planning fights in a public forum (unless it's a martial arts/boxing competition or whatever) or just generally planning illegal things publicly? Not like I expect people who plan such things to be very smart anyway.
-
You're probably going to be fine. A lot of it comes down to whether you're careful with what you're doing and don't just click on everything clickable. Doesn't mean you should be suspicious of everything, but just apply common sense.
-
It's generally good to know the source of your data, but there might be cases where you don't particularly care if some variable is passed using GET or POST. I can't think of any good example right now. Even better would be to use filter_input.
-
I can from personal experience say that you'll benefit greatly from researching other people's problems and helping solve them. Doing that you will get insight in other things you might not have wanted to look into or hadn't thought about yourself. This is particularly true for beginners, so if you think you have the solution to other people's problems, or you find someone's problem interesting, go ahead and help them. Anyways, welcome!
-
Yeah. Sometimes the EU should just mind their own business. It's particularly stupid because the user can just choose not to save the cookies if they don't want them. Just because I say Set-Cookie: foo=bar doesn't mean the user has to save it to a file on their computer. They are the ones who are ultimately responsible for actively saving it somewhere.
-
Maybe your computer is just slow?
-
Introductions and help requests
Daniel0 replied to nrg_alpha's topic in PHPFreaks.com Website Feedback
I've added a notice in the description. I'm not sure it'll help though. I bet some people would post help requests in "announcements" or "deleted posts" if they could.