As many potential employers or clients want to see what my coding practices are, I have decided to show some code samples from my recently finished projects. As you can see, code is well commented and structured, which makes it easy to follow for anyone wishing to amend it.
XHTML 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Dusan Szoke, Freelance Web Designer & Web Developer, London, United Kingdom :: Home
</title>
<meta name="keywords" content="freelance,freelancer,freelance web designer,freelance web developer,web design,web designer,web developer,HTML,XHTML,CSS,PHP,MySQL,JavaScript,London" />
<meta name="description" content="Dusan Szoke - Freelance Web Designer (XHTML/CSS) and Web Developer (PHP/MySQL), London (UK)" />
<meta name="author" content="Dusan Szoke" />
<meta name="title" content="Dusan Szoke, Freelance Web Designer & Web Developer, London, United Kingdom :: Home" />
<link href="css/layoutstyle.css" type="text/css" rel="stylesheet" />
<link href="css/typographystyle.css" type="text/css" rel="stylesheet" />
<!--[if IE 6]>
<link href="css/ie-6-styles.css" type="text/css" rel="stylesheet" />
<![endif]-->
<!--[if IE 7]>
<link href="css/ie-7-styles.css" type="text/css" rel="stylesheet" />
<![endif]-->
</head>
<body>
<!-- page begin -->
<div id="page">
<!-- header begin -->
<div id="header">
<div id="headerpart1">
<a href="index.php" title="Dusan Szoke - Freelance Web Designer & Web Developer" onmouseover="window.status='Dusan Szoke - Freelance Web Designer & Web Developer'; return true" onmouseout="window.status=' '">
<img src="graphic/logo.jpg" alt="Dusan Szoke - Freelance Web Designer & Web Developer" width="172" height="70" />
</a>
</div>
<div id="headerpart2">
Don't worry, Be happy! I'll do the job!
</div>
<!-- navigation bar begin -->
<ul id="navbar">
<li><a id="home" href="index.php" title="Home" onmouseover="window.status='Home'; return true" onmouseout="window.status=' '">Home</a></li>
CSS 2.1
/* CSS Document */
*{margin:0; padding:0;}
body{font-family:arial,verdana,tahoma,helvetica; font-size:62.5%; background-color:#c5c5c7; color:#373737; background-attachment:scroll; background-repeat:repeat-x; background-image:url(../graphic/background.jpg);}
#page{position: absolute; width: 760px; margin-left: -380px; left: 50%; top: 2px; background-color:#ffffff; border:1px solid #666666;}
/* header begin */
#header{border-bottom:2px solid #adadad; padding-bottom:10px; background:url(../graphic/headerbackground.jpg) 0 0 repeat-x;}
#headerpart1{float:left;}
#headerpart1 a{margin:20px 0 0 30px; display:block; width:172px; height:70px;}
#headerpart1 a img{border:none;}
#headerpart2{width:528px; height:130px; margin-left:232px; background-image:url(../graphic/header.jpg); text-indent:-5000px;}
#navbar{position:absolute; top:100px; left:58px; list-style:none;}
#navbar li{display:inline;}
#navbar li a{width:116px; text-decoration:none; color:#373737; text-align:center; font-size:1.2em; font-weight:bold; float:left; height:19px; margin-right:16px; padding-top:5px;}
/* header end */
PHP 5
//*******************************************************************//
// this function makes picture thumbnail //
// parameters: $max_dim - maximum dimension of thumbnail in pixels //
// parameters: $file_tmp - file of which we want to create thumbnail //
// return: $res_img - created thumbnail (passing by reference) //
//*******************************************************************//
function make_thumb($max_dim,$file_tmp,&$res_img){
// get width and height for picture
list($width,$height) =
getimagesize($file_tmp);
// get the new width and height
$img_ratio = $width/$height;
if $width > $height){
$new_width = $max_dim;
$new_height = $max_dim/$img_ratio;
}else{
$new_width = $max_dim*$img_ratio;
$new_height = $max_dim;
}
// make new picture with new dimensions
$res_img = imagecreatetruecolor($new_width,$new_height);
$new_img = imagecreatefromjpeg($file_tmp);
// resample picture
imagecopyresampled($res_img,$new_img,0,0,0,0,$new_width,$new_height,$width,$height);
// destroy unneeded pictures
imagedestroy($new_img);
}