Good v. Bad Web Development

From Digibase Knowledge Base
Revision as of 00:36, 14 March 2014 by Kradorex Xeron (talk | contribs) (Created page with "==Preface== Web development in contrast to web design refers to the actual technologies and methodologies the specific website or web platform uses to ==Use GET Responsibly=...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Preface

Web development in contrast to web design refers to the actual technologies and methodologies the specific website or web platform uses to

Use GET Responsibly

include($_GET['page']);

-or-

mysql_query("SELECT FROM table WHERE id = '$_GET['id']'");

-or-

echo $_GET['item']

Don't do this...

If you accept input into your application or site through GET variables, do not use them directly, doing so can open your infrastructure to all kinds of attacks, such as through includes, you can get people injecting remote code or accessing system configuration files.


Javascript is not a Requirement

If you are developing a site, use javascript only as an enhancement, not as a requirement, if you have an onclick handler, also set an href that does something useful for that link. It is often a belief that javascript is a requirement by the web development community because of the features it provides to make sites behave Sci-fi-like or provide smooth transitions, but at the end of the day, use it responsibly and only when you can offer a substitute .

Cookies

trackid:8e06d3861932596694527c75e1858346

Don't do this...

Do not set cookies unless the user actually logs into your website with a username and password. If your site just offers content without interaction chances are you don't need to set cookies. Setting cookies for marketing or accounting purposes is irresponsible and intrusive to users who may not know about cookies aside from a footnote in a privacy policy (to which it's even more irresponsible to expect a cookie to be set before a user can access your privacy policy).