Archive for the ‘Programming’ Category

Website speed has always been a big issue, and it has become even more important since April 2010, when Google decided to use it in search rankings. However, the focus of the discussion is generally on minimizing file sizes, improving server settings and optimizing CSS and Javascript.

The discussion glosses over another important factor: the speed with which your pages are actually put together on your server. Most big modern websites store their information in a database and use a language such as PHP or ASP to extract it, turn it into HTML and send it to the Web browser.

So, even if you get your home page down to 1.5 seconds (Google’s threshold for being considered a “fast” website), you can still frustrate customers if your search page takes too much time to respond, or if the product pages load quickly but the “Customer reviews” delay for several seconds.

(more…)

By Dmitry Fadeyev

By now, all good designers and developers realize the importance of usability for their work. Usable websites offer great user experiences, and great user experiences lead to happy customers. Delight and satisfy your visitors, rather than frustrate and annoy them, with smart design decisions. Here are 9 usability problems that websites commonly face, and some recommended solutions for each of them.

You may also be interested in the following related posts:

(more…)

10 Advanced PHP Tips Revisited

Posted: 7 April, 2009 in Programming

Here, on the Smashing Editorial team, we always try to meet the expectations of our readers. We do our best to avoid misunderstandings, and we try to spread knowedge and present only the best design practices and development techniques. However, sometimes we do make mistakes. And when we do, we apologize and do our best to correct what we’ve done.

In November 2008 we published the article 10 Advanced PHP Tips To Improve Your Programming. Apparently, according to negative comments to the post, it contained some errors and some statements that are just wrong. We sincerely apologize for our mistake, and we are truly sorry for any inconvenience we caused by it. However, this simple apology is not good enough. To solve the problem, we asked Chris Shiflett and Sean Coates, two PHP gurus, to take a closer look at the article, explain its errors and make it perfectly clear what is actually right and wrong in the theory and practice. This article is a professional response to our article published a couple of months ago.

(more…)

Hide browser referer information with this piece of PHP code sparkled with little javascript to fix IE back button and learn how to implement it on your web site.

Hiding the referer prevents your web page url from appearing on other systems referrer logs.

This information is sent by browsers to the web server of the web site page you are visiting. Web servers log this information to identify the website pages where people are visiting from, for statistical, promotional and security reasons.

However, because referer information is a url of the web page where you were on before clicking on a link, it might contain confidential information that must not be exposed. One example is appending SESSION ID to the url. When user clicks on an external link from that page, SESSION ID is also sent as part of referer url to that external page and this is one way to hijack sessions.

To hide the referer information, implement a redirector page say “redir.php” and put in the html code below:

<html>
<head>
<meta http-equiv=”refresh” content=”0;URL=<?php echo $_GET[‘url’]; ?>” />
</head>
<body>
</body>
</html>

The code above only works on Internet Explorer or IE and Firefox browsers. And it breaks the IE back button. Here is a fix:

<html>
<head>
<meta http-equiv=”refresh” content=”0;URL=<?php echo $_GET[‘url’]; ?>” />
</head>
<?php if (preg_match(‘/^Mozilla\/.*?\(compatible; MSIE (8|7|6|5)\..*?\)/’, $_SERVER[‘HTTP_USER_AGENT’])) : ?>
<script type=”text/javascript”>
window.self.location.replace(‘<?php echo $_GET[‘url’]; ?>’);
</script>
<?php endif; ?>
<body>
</body>
</html>

The code now contains a condition to match IE browsers then insert the Javascript code to fix IE back button.

On your pages, prefix the href of the external links with redir.php?url= like below:

<a href=”/redir.php?url=http://www.jampmark.com”>

There are a number of reasons why you would hide the referer information but please use it wisely.

A compilation of useful Smarty template scripting tips and techniques to help build smarter dynamic templates for PHP programmers and template designers. Great practical resource for people who are learning to script Smarty templates. Saves valuable time on research.

(more…)