Menu

1 / 2

Why the Link Box Is name="url" and the Quality Dropdown Is name="format" — Boring Field Names That Save a Small Site

DEV Community: php·Mobeen Ahmed·8 days ago
#bFYBCIV0
#devto#dev#name#format#field
Long article (708 words) — no AI summary yet.
Reading 0:00
15s threshold

When I rebuilt my video downloader as plain PHP on shared hosting, I spent an afternoon on a decision that looks trivial from the outside: what to call the form fields. The link box is name="url" . The quality dropdown is name="format" . Nothing else. No prefixes, no clever abbreviations, no input1 and select1 . That afternoon was worth it, because those two names now show up everywhere — in the JavaScript, in the tests, in the logs, and in my own head whenever I debug something at midnight.

The link box: name="url"

The first field takes a pasted video link. I could have called it link , video_url , paste_here , or nothing at all. I chose url for three practical reasons.

First, it says exactly what it holds. When I read $_POST['url'] in resolve.php , there is nothing to translate. The value is a URL, the key says URL, and anyone reading the code six months later — usually me — does not have to guess.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.