Error vs Exception, Part 2

Posted by: Abraham

Categories: PHP| Programming Concepts

2 Sep 2010

In this series, I’m going to take a look at both PHP’s error and exception models — what each is, how they work, and how and when to use the one or the other.

In this instalment, I’ll begin unfolding exceptions by expanding on the concept, as well as explain why they’re needed at all.

Continue reading »

Session Cookies faulty in IE8

Posted by: Nico

Categories: PHP

23 Aug 2010

I didn’t quite know what to call this post, because I really want it to show up in search engine results. Why? Because I couldn’t find the solution online and it needs to be there! I guess the heading could have been any of the following:

  • Cookies broken in IE8
  • Session variables disappear in IE8
  • IE8 not keeping session data
  • IE8 loses cookie
  • IE8 loses session on session_regenerate_id() call
  • IE8 has more mood swings than a 2 year old girl

Now you have a better idea what this post is about.

Continue reading »

Most web developers know that you can apply multiple classes to an element in the form of a space-separated list:

<div class="comment author">...</div>

and then style the element with CSS based on either of those classes :

.comment { border: 2px solid #000; background: #F7F7F7; }
.author { border: 2px solid #F00; }

But what developers often don’t know, is how to target an element containing more than one classnot elements which contain only one of the classes, but only elements which contain all of the classes. So in this article, I’ll show you how to target an element which contains both (class X AND class Y), not just (class X OR class Y).

Continue reading »

Custom website cursors

Posted by: Nico

Categories: CSS| HTML| Javascript

13 Aug 2010

How to use custom cursors on your website

This topic can be very simple, but can also be a bit frustrating, depending on what exactly you want to do, so I will try to give a clean breakdown to simplify the process.

How to use a custom cursor on an element

To enable a custom cursor whenever your mouse hovers over a certain area of a website, just use the css cursor property, like this:

Continue reading »

div position center of screen

Posted by: Nico

Categories: CSS| HTML

30 Jul 2010

An age old question with a simple answer:
How to position a div in the center of (any size) browser window?

Once you have created your html page, create the div you wish to have in the center of the window and give it an id:

<div id="container">
  My center div...
</div>

From here on we have two options: either CSS or Javascript (using JQuery) :

Continue reading »

MySQL copy data from one database to another

Posted by: Nico

Categories: MySQL

28 Jul 2010

Let me show you how to copy data from one database to another in MySQL. First of all, you must be sure that you have the rights on both databases, with the user/connection you are currently logged in as. As soon as you have that, its really quite easy:

Continue reading »

Introduction to HTML5 – Part 1

Posted by: Deon

Categories: HTML

20 Jul 2010

Part of doing Web Development is staying on top of your game and up to date with all the new techniques and technologies constantly coming out. Currently, the most prominent of these new toys are HTML5 and CSS3. In this series I’m going to be doing an overview of HTML5: What you can use now, what you should hold back on, and what you can do with it.

Part 1 will cover the structure of your html documents when switching from html4/xhtml to html5.

Continue reading »

Breadcrumbs in google search results

Posted by: Nico

Categories: HTML| SEO

14 Jun 2010

If you configure your site correctly and have a breadcrumb trail as part of your site, you can get that trail to display in google, as in the following image :

Google breadcrumb view

Google breadcrumb view


Having breadcrumbs display in google can really help draw visitors to your site as they will be able to see exactly where they are going. I took a quick look at trying to get this set up :

Continue reading »

Question

In Javascript, how does one call a function when the name of the function is stored as a string in a variable, such as this :

var tmp = "function_name";

This is something I often encounter, especially when building larger AJAX applications where you’d like to be able to pass along the name of a function to call when the AJAX call completes, so I thought I’d post a quick note as reference.

Continue reading »

Force download on click in PHP

Posted by: Nico

Categories: HTML| PHP

25 May 2010

Many newbie web developers struggle with this, so I thought I’d write a quick tutorial on how to force a user’s browser to download a file when a link is clicked, instead of the file (such as a pdf) opening within the browser.

Continue reading »

About this blog

Based in South Africa, we're a web-development company...

Authors

Powered by Authors Widget

@anvilstudios – Twitter