Cars owners sell quickest revealed: Tesla tops the list AGAIN but an old favourite proves a keeper
'British man is LYNCHED in Ecuador' by furious mob who dragged him out of police station and burned him alive after he was arrested over fatal shooting of a local man
My company pension is moving to an insurer - what happens if it goes bust? STEVE WEBB replies
Joe Biden accused of Easter photoshop fail
He may be playing in the French second tier, but here's why Andy Farrell MUST make 36-year-old Courtney Lawes a Lion again, writes CHRIS FOY
BBC chef's pub is turning our peaceful town into a louts' paradise: Neighbours at war over 'noisy' outdoor events 'attracting drunken crowd'
I took on Bridge Of Lies and was left red-faced by a mortifyingly simple blunder - there's a reason the quiz is NOT as easy as it looks
Developer scored huge own goal by deleting almost every football fan in Europe
Who, Me? Monday mornings are a nasty time of week that can be redeemed by two things: bantering about weekend sporting results, and reading another edition of "Who, Me?" – The Register's weekly column that shares your stories of dropping the ball at work but somehow recovering for at least an honorable draw.…
The tell-tale body language sign that could give away a psychopath
I was so high on gas and air while giving birth that I asked the midwives to rate how much fun they were having
Bank Holiday boozers wake up with sore heads after raucous Easter Sunday antics in Leeds and Newcastle
Council's 'crazy' plans to prioritise Welsh over English in schools blasted by teachers... but what do parents think?
The stunning Essex home with its very own treehouse and Japanese garden
Chaotic scenes as dozens of travellers swamp Harrods for traditional Easter meet-up - after previously moaning department store wouldn't let them in at Christmas
CodeSOD: The Variable Toggle
A common class of bad code is the code which mixes server side code with client side code. This kind of thing:
<script> <?php if (someVal) { ?> var foo = <? echo someOtherVal ?>; <?php } else { ?> var foo = 5; <?php } ?> </script>We've seen it, we hate it, and is there really anything new to say about it?
Well, today's anonymous submitter found an "interesting" take on the pattern.
<script> if(linkfromwhere_srfid=='vff') { <?php $vff = 1; ?> } </script>Here, they have a client-side conditional, and based on that conditional, they attempt to set a variable on the server side. This does not work. This cannot work: the PHP code executes on the server, the client code executes on the client, and you need to be a lot more thoughtful about how they interact than this.
And yet, the developer responsible has done this all over the code base, pushed the non-working code out to production, and when it doesn't work, just adds bug tickets to the backlog to eventually figure out why- tickets that never get picked up, because there's always something with a higher priority out there.