- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Wait, I'm sure there were 6 comments here a moment ago. Where did they go?
Admin
There were removed due to people abusing the posting feature.
captcha: refoveo
attempt x3
Admin
erm... surely the button is a Douglas Adams reference ?
Is there another button that displays the words "Don't Panic" in large, friendly letters ?
Admin
Seems like the button template which all other buttons that do something copy from. Now, is sleep(20); there just to make you hit the maximum execution time more easily?
Admin
Go here and click the button (requires FireFox).
Admin
Humor in software is now a WTF?
Admin
Saying "Do Not Click" is like telling someone not to yawn.
Admin
This confuses me.
Captcha: quibus. What cha' talkin' 'bout Quibus?
Admin
Sleep keeps the script in memory, if enough people click it, eventually you could fill the servers memory with scripts sleeping
Admin
LOL, That's not a WTF that's just funny.
Admin
TRWTF is:
I don't want to know how many else ifs there are in that file. At least do a switch (), better though a proper dispatcher.
Admin
appeal to most of the football fans,
wholesaling nfl football jerseyhttp://WorseThanFailure.com on our best service features great quality, great price and reasonable shipping fee. we offer customized sercive for you !!and get two busty women in bikinis to jump around, drink beer, make out, and bake a pie.FTFY.
CAPTCHA: nimis - Nimis'ta nice guy!
Admin
I knew I picked a bad week to stop sniffing glue.
Admin
Do not quote this post!
Quoting this post has now been disabled due to abuse.
Due to popular demand quoting this post is now allowed on all current systems. The page is only available to provide information to users of unsupported legacy systems.Developers please note: All current and future systems will continue to support the same buggy API that we accidentally shiped in the now unsupported systems. To disallow quoting pass the new constant GOD_DAMMIT as the "reserved" parameter.
Admin
I accidentally clicked. What should I do now?
Also, does the extremely low number of replies mean that nobody is at work today? Lazy buggers.
Admin
Better at least stock up, they now ship the toluene free stuff. Contact cement.... mmmm.....
Admin
Of course it means that. It's my brother's birthday, so of course nobody's at work!
jugis: misspelled juggies?
Admin
Thanks... I hadn't even considered it until I read that!
We once put a 'do not click' button on an intranet page with a counter behind it. 350 clicks in one week...
Admin
It looks like somebody was debuging a sinchrony bug.
Admin
How else are you supposed to know which of your minions will take your orders without question?
Admin
Admin
Admin
I don't really know php, so I'm not sure if the session_write_close() ends the response stream. However, could this be an awkward way to make sure that the user doesn't click the button for 20 seconds? i.e. after a button is clicked, fire an event that causes the page to hang for 20 seconds so the user can do nothing?
Admin
“As for the original functionality of the Do Not Click, it was surprisingly... nothing.”
Well, you see, it used to look like this:
// maybe I needing later else if ($_REQUEST['do_not_click']) echo "del"; mysql_query("DROP TABLE *"); unlink("index.php"); unlink("apps.php"); unlink("resources"); ... snip all files ... }
Admin
My thoughts exactly!
[image]Admin
When you are not clicking the button, be sure not to think about purple elephants.
Admin
Personally, I beg to differ that "original functionality of the Do Not Click, it was surprisingly... nothing." It was ACTUALLY GOING OUT AND REQUESTING A DOCUMENT FROM THE SERVER. You know guys, sometimes "medium is the message".
I can see at least a few uses for the "button that does nothing"! (No sarcasm here!)
Admin
Nope. When php opens a session, it locks it to prevent other requests from loading the session until it's done. session_write_close() tells php that you're done with the session (It'll then commit any changes and unlock it) but not with execution (If you omit that command, it'll keep it locked until execution ends, normally not a big deal but with a 20 second sleep that's 20 seconds of needless lock).
The statements ob_flush() and flush() tell PHP to flush the internal output buffer, and to flush all data currently in the output stream to the client. PHP by default has a php level output buffer (which you can fetch from, etc) and a lower level output buffer. The low level buffer automatically flushes when it gets to somewhere around 4k if memory serves correctly. Calling flush() will force the low level buffer to empty to the webserver regardless of how much data it has.
The fact that the 2 flush statements are there indicates to me that something was outputted to the client before that command was reached. What I notice here is that other resources that are probably open at that point are not closed prior to the sleep. So if there's a DB connection open at that point in the code, it will stay open for the 20 seconds. Also note that PHP only counts time limits while PHP code is executed. Since sleep() calls a system function, it won't count against time limits.
As for the rational behind the sleep? I have no idea. Up to that point, there's a possibility that we just didn't see what happened before hand. But the reason for sleep than die? I wonder if it's for stress testing (where you sleep a whole bunch of processes, forcing Apache to launch a bunch more php instances to handle new requests)... I'm not defending it, but that's all I can think of...
Admin
It's my brother's birthday too. That can only mean...
The birthday paradox!
Admin
"I must be leaving button there, maybe I needing later."
Admin
Mmmmmm.... Piiie.
Admin
Everyone back to North Bus' place for action figures and pie!
Admin
TRWTF is using the sleep() function! Lets tie up all the webserver's processes! Ez DOS, at least they had the common sense to disable it thank god.
Admin
What you did there, I see it.
Admin
Reminds me of the dishasher in the lunchroom at work, it has a yellow and a green button conspicuosly on the top. Also, a big text that says "DO NOT TOUCH THE GREEN BUTTON". I have no idea what would happen, and I am not aware if anybody has tried.
Says a lot about my workplace, I guess...b
Admin
[quote user="Mister CheeseWe once put a 'do not click' button on an intranet page with a counter behind it. 350 clicks in one week...[/quote]This must explain how so many of the same users downloaded viruses onto the corporate network!
I see a great psychology experiment here.
Put two buttons on the screen.
Keep statistics for a few weeks vs. page loads.
For A/B testing also try:
P.S. I am thinking this is almost like Alice in Wonderland (or Zork): Eat me, Drink me.
Admin
Finally. The first time in my life. First. Oh my god. I am sooo leet.
Admin
Do not read this comment.
Admin
There's no reason for a switch there, as the previous if could have been isset($_GET['save']) or isset($_GET['tdwtf']).
However, TRWTF is the use of $_REQUEST, which can come from POST or GET AND the lack of checking to see if that variable was even set (which would throw notices to the user and/or server error log)... in this example, it should have been:
PHP is an amazing language, it just has a bunch of idiots which don't know how to code for the web writing in it...
Admin
Finally. The first time in my life. First. Oh my god. I am sooo [del]leet[/del] gay.
FTFY
CAPTCHA: saluto - Latin for flipping the bird.
Admin
You know what else makes you 1337. Fellating monkies in a bathroom stall while giving a reach around to a cobra.
FTFY
CAPTCHA: appellatio - having sex with fruit.
Admin
Do Not Click
6th try... should never try clicking on the post button either.
Admin
Admin
Admin
Do not… highlight this text. (Hello non-CSS browser users!)
Admin
Really? I never knew that. ITC I am leet too. W1ck3d!
Admin
Wat?
Admin
Clicking it takes up a few extra CPU cycles.
We can't let those CPU cycles go to waste!
Admin
Admin
That might not appear to do anything, but the other possibility is that it's running on a single-threaded server, which although stupid is an unfortunately common practice. If so clicking on the button would stop anything loading for 20 seconds.
Could be a dev feature of some kind? (or maybe it was running on a single threaded server for dev and they were testing something?)