How big HTML images / CSS / JS / png / etc. should be to fit network packet (MTU) efficiently

List of little things that will make your website much faster. Not every webmaster knows, that 1 extra byte in jpg image, can cause 100% speed reduction / penalty for your website visitor. When you learn that MTU for Ethernet is 1500 bytes with actual data / payload size of 1460 bytes, you can calculate …

HTTP POST must be encoded and windows.location is encoded

When using JavaScript window.location in your code, be aware, that window.location is encoded using JavaScript escape function. It is not always obvious because characters, that get encoded / decoded using escape() / unescape() is rare in urls. Use the following syntax to get human readable url: unescape(window.location) URL: http://example.com/test url/ window.location: http://example.com/test%20url/ unescape(window.location): http://example.com/test url/ …

PHP $_POST returns only one item for SELECT multiple HTML tag

PHP developers decided that values posted from HTML select tag with attribute multiple, somehow overwrites some internal variable data. Basically it goes like this – you have the following form with a select tag: <form action=”/post.php” method=”post”>   <select name=”MyMultiSelect” multiple>     <option>one</option>     <option>two</option>     <option>three</option>     <option>four</option>   </select>   <input type=”submit” value=”send”> </form> and in PHP you try to …