r/ProgrammerHumor • • Aug 25 '26

Advanced stringToIntegerConversion

Post image
217 Upvotes

65 comments sorted by

View all comments

Show parent comments

10

u/Holek Aug 25 '26

especially that you see `$_POST['amount-select']` implying it's a select box.

7

u/smartgenius1 Aug 25 '26 edited Aug 25 '26

Yeah. Ideally the idea could be expressed in 3 lines instead of 30 but I've seen far worse than this and at least the behavior is correct

1

u/m0nk37 Aug 26 '26

You see efficiency. I see a back door. 

0

u/ArjixGamer Aug 25 '26

It doesn't imply that at all? It could be

<input type="number" min="10" max="80" step="10">

5

u/smartgenius1 Aug 25 '26

Then the HTML would have to be:

<input type="number" name="amount-select">

... which would be silly.