CancelImage Upload

Topics: Webdesign and Programming
Read our latest entries.
Posted by Garren Harland on November 11, 2009, 11:57 am.
Previously I have discussed how a JavaScript function can be called upon via an anchor tag. The same principles of course are also applicable to HTML buttons, images, and other HTML elements.
Click here to read on.
Posted by Garren Harland on September 30, 2009, 2:22 pm.
Unlike PHP, where a variable can be called upon at any time without being previously initiated, JavaScript requires that a variable has been defined properly before it can be used.
Click here to read on.
Posted by Garren Harland on September 30, 2009, 10:39 am.
In a previous tutorial I have discussed how a numeric array can be sorted with the elements being ordered from the smallest to largest value in JavaScript. However, what if we wanted to turn things around, and sort the numbers in the order from largest to smallest?
Click here to read on.
Posted by Garren Harland on September 30, 2009, 10:17 am.
If you want to load a specific section out of an array in JavaScript, here is the function that you are looking for. Its name is slice, and it does just that, returning a specified slice of an array. The key of course is its definition.
Click here to read on.
Posted by Garren Harland on September 29, 2009, 10:35 am.
Sparse as JavaScript array functions may be, there is one available to reverse the order of the array. It's name, no surprise, is reverse(), and here is how it is defined.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 6:58 pm.
To join two arrays in JavaScript the function concat() is required. This function needs to be placed at the end of the first array, with the second array contained inside it's brackets. Here is how it is implemented.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 6:05 pm.
As previously discussed, all that is required in order to sort an array in JavaScript is to define the function sort(), after the array that requires putting in order. However, a bit of trickery is required to indeed sort a numeric array according to it's numeric values.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 5:34 pm.
Quite often when dealing with arrays the need arises to sort them alphabetically. In JavaScript this is accomplished via the function sort(), which can be called upon at the end of an array object.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 3:37 pm.
Changing the float property dynamically is another one of those annoying instances where browser manufacturers could not agree with each other. While Netscape decided that the property should be accessed via cssFloat
Click here to read on.
Posted by Garren Harland on September 28, 2009, 3:00 pm.
The standard HTML form submit button is all well and good. But as soon as you start working on more complex web applications you will probably sooner, rather than later, require a JavaScript function via which a specified form can be submitted. Here then is just that function.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 2:48 pm.
Reset buttons are not the only method available by which form fields can be reset. Indeed the simple JavaScript command reset() can be called upon from numerous elements including anchor tags and onClick images. Here is the code that needs to be placed within these element's onClick or href attributes.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 1:05 pm.
Although maybe not as object orientated as other programming languages, JavaScript does allow you to initiate and make use of your very own object. To do this all that you require is a simple function. In our example we will use a function called newUser(), where new users can be added and initiated.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 12:03 pm.
When developing an interactive web application with a windows like user interface you may need to know when a mouse button has been pressed, and when it has, which one.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 11:28 am.
If you are developing a web application, and require the service of some special keyboard combinations, you may wish to bring the Alt key into play. Here then is a tutorial on how the Alt key signal can be detected with JavaScript.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 11:00 am.
As a frequent user of various IT applications you are no doubt familiar with shortcut keys. And while these are common among stand alone applications they are rarely useful or necessary on individual websites. This however, may not apply for your web applications, such as intranets, and other client orientated programs.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 9:35 am.
If you are programming a fancy typing interface for your web application you will without a doubt need to find out when a user has actually pressed the shift key. It's the only way after all for your application to then decide when to type small or large letters.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 6:46 pm.
While the event onkeyup detects the instance when a user presses a key, by itself we will not know which key has been pressed. For this we will need to consult the event object to find out the Unicode of the key in question. Here is the code with which this task can be accomplished.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 6:21 pm.
Every day the demand on web applications increases, requiring them to look and feel more and more like a windows desktop environment. Achieving these effects requires the use of JavaScript event functions.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 5:29 pm.
Returning to the last place a user has visited is easy with JavaScript. All that is required is the windows history object, and the function back().
Click here to read on.
Posted by Garren Harland on September 27, 2009, 5:11 pm.
In JavaScript there are two types of scroll functions. One is scrollTo, which takes a user to a specified set of page coordinates. The other is scrollBy(), which is far more handy for dynamic web pages where the scrollTo coordinates might have changed.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 4:47 pm.
The following code should only be applied to target blank or pop-up windows, since it requires that the window has not already taken up 100% of the page's width and height. However, if this isn't the case, the following function can be very useful indeed if you require a smaller window to be placed in a very specific location.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 4:33 pm.
Usually the code discussed on this page would be applied to a page that was opened via a target blank anchor tag. Indeed, resizing a normal browser window (instead of a "pop-up" window), may cause your website visitors a certain level of concern.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 1:17 pm.
To focus on, or blur the curser from a form element in JavaScript is simple. All that you need is the following two functions.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 12:22 pm.
Embedding a Java Applet is a pretty straight forward task. However, there is no point embedding an Applet if the browsers Java Component has been disabled. Here then is the JavaScript code to find out whether or not this has been the case. Note that we are talking about Java Applets here, not JavaScript. If JavaScript has been disabled you need to make use of noscript tags.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 12:01 pm.
Ever wanted to know how many of your visitors actually use Mac or Windows? Are you curious as to what percentage have actually ventured on to Linux? Then you will be interested in the code discussed on this page.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 11:46 am.
If your website makes use of cookies, you will no doubt need to find out if your visitor has actually still got them enabled on their browser. If they have you can carry on with business as usual. If not however you may want to go down a different path in order to prevent script errors.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 11:20 am.
If you want to get to know your website's visitors a bit better, you may want to find out what language's their browsers are in. Alternatively you may even want to adjust the language that your website is displayed in based on the browser language.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 10:57 am.
In order for your website to become a success you may need a good idea about where your user is coming from. With the following JavaScript code you will easily find out what the last destination was, and how they came to you. A great method therefore for showing who's linking to you.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 7:12 pm.
If you are working on a multi domain platform you may need to find out through which name the website is being accessed. In JavaScript this task can be accomplished via the following code.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 5:43 pm.
Accessing the HTML title object via JavaScript and DOM is not really a task of great difficulty. All that is needed is the correct path. Since this path consists of two words it would really take a grand master in failure to get this wrong;-):
Click here to read on.
Posted by Garren Harland on September 25, 2009, 5:17 pm.
I have frequently discussed how the JavaScript function getElementById() can be used to access an individual HTML tag, and manipulate it's content, styles and properties. And while this function more than fulfils the requirements for accessing an individual HTML element, what if we wanted to access a specific set of tags, let's say every span tag within our document?
Click here to read on.
Posted by Garren Harland on September 25, 2009, 1:03 pm.
To load the a browser's current location via JavaScript the following code is required. Simply specify the document object, and request the extension URL.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 10:30 am.
If you have a page that calls for functionalities within a pop-up you may need to check to make sure that it is indeed still open, and that the user has not closed it. Here is how the pop-up's status can be checked via JavaScript.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 10:00 am.
Thanks to JavaScript's timeout function various fade in, and other effects can be created, that look similar to those found within Flash Programs. Here then is how the JavaScript function setInterval() can be set.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 8:20 pm.
To find out the available width and height of a users screen, taking away the space taken up by the Operating System's taskbar, the following JavaScript code can be used.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 7:27 pm.
To find out what the bit depth of a visitors screen is using JavaScript you will need to use the following code.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 6:54 pm.
Note that this tutorial discusses how a user's screen dimensions height and width can be established via JavaScript. This is not to be confused with the browser's current height and width, but the actual computer screen through which the website is viewed. Depending on this setting you may choose to make layout changes to your HTML document, to suit screens with greater or smaller width.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 6:32 pm.
As you are no doubt aware, JavaScript does things slightly different to other programming languages. In JavaScript then, instead of inserting a regular expression into a bracket, along with the variable to be validated, we actually load the regular expression into a variable, and test the variable to be validated against the regular expression using the function test.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 5:16 pm.
Joining array elements in JavaScript, is while slightly different to most programming languages, not that difficult. Indeed, all that needs to be done is specify the function join at the end of the array variable, and defining what characters the individual array elements should be joined together with.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 5:01 pm.
You would think JavaScript would already have a pre-built in shuffle function. Something along the lines of the PHP function shuffle(). Well, unfortunately JavaScript does not posses such a function. Meaning it is up to us as programmers to create it ourselves.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 3:14 pm.
Producing random numbers in JavaScript is a rather complicated process, when compared to most programming languages, such as PHP, where only a simple rand() definition is required to return a random number.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 2:42 pm.
To calculate the square route of a number in JavaScript, we need to use it's Math Object. By adding the square route extension (sqrt) and specifying the number inside the brackets, we can calculate the square route.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 2:20 pm.
If you are in need of PI within your JavaScript code, and do not feel like having to enter the exact number every time you require it's services, you need not worry. Here's is an easy way of accessing it.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 1:49 pm.
Throughout your PHP programming career you will no doubt at some point (or rather at many frequent points) require a function to return the size of a given array. Here then is a code example making use of just such a function.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 1:33 pm.
If you are a programmer with experience, yet new to JavaScript, you will no doubt sooner or later be looking for a size of array function, equivalent to the function sizeof() in PHP. In JavaScript this information is returned using the following code.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 1:15 pm.
If you are new to programming this article will introduce you to the advantage of arrays over standard variables. While for experienced programmers this guide merely serves as a reference in regard to how arrays are defined in JavaScript.
Click here to read on.
Posted by Garren Harland on September 22, 2009, 7:37 pm.
On a dynamic website you may want to enable your users the ability of deciding for them selves whether or not background images should be repeated vertically, horizontally, both, or not at all. Here then is a quick tutorial on how to accomplish this task for the body property.
Click here to read on.
Posted by Garren Harland on September 22, 2009, 7:06 pm.
JavaScript may not be the most difficult programming language to learn, yet it is one of the most annoying due to different browsers having their own interpretations of various sets of code, and some do not even include functions which others do.
Click here to read on.
Posted by Garren Harland on September 21, 2009, 2:09 pm.
Previously I have discussed how the horizontal scroll bars of a website can be prevented from appearing using CSS. However, the CSS property overflow can do even more. It can prevent scroll bars from appearing on your website entirely!
Click here to read on.
Posted by Garren Harland on September 21, 2009, 1:31 pm.
Horizontal scroll bars are, when not required, one of the most annoying elements a web designer can bump into. And while usually they can be resolved with some careful HTML and CSS programming, sometimes they appear to be un-avoidable. Especially with layouts that require embedding pages via Frames.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 7:22 pm.
Previously I have discussed how the CSS Opacity property can be accessed via JavaScript, and how it can be used to fade an image on mouseover. This page then will discuss how a slow image fade-in effect can be achieved by adding a bit more code to the standard opacity changing JavaScript functions.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 5:29 pm.
In order to disable and enable textareas the disable/enable property needs to be set, unset within the form element. Here is how this goal can be achieved using JavaScript and the getElementById() function.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 4:36 pm.
Inserting line breaks into a textarea with JavaScript is not as bigger operation as it may sound. In essence a line break inside a textarea is defined as \n. There is no need to insert BR tags or the like.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 4:03 pm.
Let's face it, if there is one thing the internet was built for, it is countdown clocks. Countdown until the NBA season starts, countdowns until a movie is released and of course countdowns until the end of the world are ever popular examples.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 2:54 pm.
As far as programming in JavaScript goes, there are few simpler commands than the one used to call upon the browser's printer.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 1:24 pm.
At the age of 16 years, every citizen in the Republic of South Africa is issued an identity document, which is a passport sized 8 page booklet. Inside this passport is the individual's national identification number, and this page discusses how it's format can be validated using regular expressions.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 12:33 pm.
New Zealand's National Health Index Number primarily servers the puropse of providing a unique ID Code for individuals within the country's health system. Format wise it consists of 7 characters, the first 3 being alphanumeric, while the last 4 are numbers.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 11:56 am.
The Permanent Account Number (PAN) is India's equivalent of a National Identification Number. It is a 10 Symbol code that is issued to all taxpayers by the Indian Income Tax Department. It is a standard requirement for opening bank accounts, the instalment of a personal phone line, and receiving a salary. Naturally it's main purpose is to help prevent tax evasion.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 11:21 am.
As you are probably aware the US equivalent of a national identification number is the Social Security Number. This 9 digit number is issued by the Social Security Administration of the United States Government. Usually this number is applied for by parents soon after a child's birth.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 9:43 am.
If you are performing a preg_replace on a string it might well be that you do not mean to replace every match within it. Instead you might only want to replace the first item, or a specific number of items.
Click here to read on.
Posted by Garren Harland on September 11, 2009, 11:36 am.
Let's face it: only the biggest Photo enthusiasts on the planet will want to spend endless amounts of time resizing hundreds of images one at a time. Your average individual or web designer neither has the will or the passion for that kind of display of commitment.
Click here to read on.
Posted by Garren Harland on September 7, 2009, 11:41 am.
If you are writing a PHP application that is dealing with data related to weather conditions you will no doubt at some point have to convert between Celsius and Fahrenheit. To perform these conversions two simple formulas are required.
Click here to read on.
Posted by Garren Harland on September 7, 2009, 10:52 am.
England has never been a country willing to fit in. Never has there been any interest in driving on the right hand side of the road, and when asked how many kilograms are found within a Stone, the reply will often be along the lines of.
Click here to read on.
Posted by Garren Harland on September 6, 2009, 9:41 pm.
To insert bold, italic, underline or any other HTML tags into a selected range within a textarea we need to first of all establish what area has been highlighted. In JavaScript we can access this property through the following path:
Click here to read on.
Posted by Garren Harland on September 5, 2009, 12:44 pm.
Validating a phone number is easy. That is if you merely want to make sure that the user has indeed entered a number, and not used any alphanumeric letters.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 10:39 pm.
If you want to give your users a specific code you will need to make sure that it really is random and unique. To accomplish this task PHP has a suitable function to offer, as it usually does.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 5:45 pm.
While most of us have gotten used to the idea of styling div and span tags, and to shape and mould them into something that fits our purpose, there are indeed quite a few other standard HTML tags out there that could bring a bit of spice and organisation into our code.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 4:47 pm.
Although not used as much now days, one of the anchor tags original and main purposes used to be to actually act as an anchor. This means that you could define a place inside a text where the browser would automatically scroll down to if a link was clicked on.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 3:39 pm.
The easiest way to load all the image source attributes from any given HTML document with PHP is by using the DOM library. If you have not encountered DOM functions before you are in for a treat. They make accessing individual components within a HTML document very simple, often providing easy solutions where previously you might have had to string together regular expressions.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 3:10 pm.
Loading all the links from a specified website automatically may sound like a huge task? Well, thanks to PHP's DOM library it is a piece of cake. Here is a step by step guide to loading all the link tags contained within a specified page.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 1:14 pm.
The following page will discuss how to load an image's size details into an array. These details can come in handy with functions to create thumbnail versions of an image, or simply to specify an image's exact dimensions inside an image tag.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 11:58 am.
If you own an interactive website where your users can upload their files, you will need to insure that each file has a unique name that can be used as an identifier. One way to accomplish this task is to add a timestamp to the filename. Granted two users could upload a file with exactly the same name at exactly the same time. But unless you have a website with billions of visitors per day you should be safe.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 11:16 am.
While deleting a folder is no more difficult than deleting a file (though requiring a different set of functions), there are a few things that need to be taken into account. For starters that the file will not be removable till you have deleted each of it's files one by one. To accomplish this you will need to use a combination of the function readdir() to load all the filenames within a folder, and then one by one deleting them with the file delete function that I have previously discussed.
Click here to read on.
Posted by Garren Harland on September 5, 2009, 10:43 am.
While deleting a file in PHP only requires one simple function, you will want to contain it in a pack of if statements that indeed check for whether or not the file first of all exists, and if it does you will want to know if it has indeed been deleted.
Click here to read on.
Posted by Garren Harland on August 31, 2009, 11:36 am.
The following tutorial discusses how the metric unit meters can be converted into yards and feet with the help of PHP. Naturally enough these same conversion numbers can be used to perform the conversion in other programming languages.
Click here to read on.
Posted by Garren Harland on August 31, 2009, 10:37 am.
This tutorial will discuss how Kilograms (KG) can be converted into stones or Pounds with PHP. Especially the stones are easy to calculate from KG, once the number of pounds has been established. For the sake of accuracy this in-between step can be seen as a necessary one.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 8:47 pm.
The following page discusses how regular expressions can be used to validate the British National Insurance Number, which is allocated to ever UK resident within the United Kingdome upon their 16th birthday. This number is usually received in a card format, containing a 9 digit code, consisting of the following format, 2 letters, 6 numbers and then to finish another letter.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 6:33 pm.
If you are looking to send both a HTML and Plain Text version of an email in PHP, you will require a more advanced format of the PHP mail() function. To make this work first of all a HTML and Plain Text alternative have to be written.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 5:30 pm.
Although this should usually not happen to an organised programmer, there may come a time with 30'000 plus lines of code, that a track is lost on a certain variable, and that a function is required to check what type of variable once was defined.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 4:59 pm.
Cookies are a useful tool for returning visitors. For instance login details and other items can be stored, and old session states from the last visits can be stored based on these.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 4:17 pm.
A lot of programmers struggle to understand the principle behind headers, and how they are supposed to be defined right at the start of a pages code. It is no good defining them halfway down the page.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 3:51 pm.
When you have thousands and thousands of lines of code it is sometimes hard to tell if a variable has already been set. Of course most programmers will simply check if the string is equal to NULL, but this may not be sufficient all the time. A string can after all have been set, and then later on been given the value of NULL.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 2:14 pm.
As you are no doubt aware speech or quotation marks in the wrong place can cause havoc within a PHP code. The following example for instance will without a doubt produce an error.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 1:27 pm.
To choose between different Content-Types for Russian Cyrillic symbols in PHP we can use the function convert_cyr_string(). This function enables us to switch between the following character sets.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 1:08 pm.
To count the number of appearances of each character within a string we can use the following PHP function.
Click here to read on.
Posted by Garren Harland on August 29, 2009, 6:56 pm.
There are two ways to call upon a JavaScript function via a HTML link tag. The first is to simply set the onClick property available in most HTML element.
Click here to read on.
Posted by Garren Harland on August 29, 2009, 1:50 pm.
There are two ways of defining the background color of a website's body, and other HTML elements. The first is the standard HTML method employed by most beginners. The second method is the more professional way of setting the background property in HTML, by using Cascading Style Sheets (CSS).
Click here to read on.
Posted by Garren Harland on August 29, 2009, 11:22 am.
When defining a JavaScript Confirm Message Box an action needs to be defined for each reply. This is accomplished by creating a variable through which JavaScript can tell which response was chosen.
Click here to read on.
Posted by Garren Harland on August 29, 2009, 10:44 am.
Here is a table containing the ASCII code equivalents of the Russian Cyrillic Alphabet. Note that these codes will not work on all browsers!
Click here to read on.
Posted by Garren Harland on August 28, 2009, 7:09 pm.
Encoding data to be sent via AJAX can turn into a nightmare in some languages. Usually encoding the data with the JavaScript function encodeURIComponent() and decoding it with a function such as PHP's rawurldecode() will prove enough to send and receive data the other end via AJAX. However, this is not always the case. Recently I had a Russian client who needed a guestbook. And although the AJAX worked fine in sending Latin characters, and even managed to post German and French letters such as ä, ë, ö and ö, the Russian characters were misinterpreted.
Click here to read on.
Posted by Garren Harland on August 28, 2009, 4:33 pm.
To retrieve an individual character's ASCII value the function charCodeAt() can be used, which is the JavaScript equivalent of the PHP function ord().
Click here to read on.
Posted by Garren Harland on August 28, 2009, 2:50 pm.
The ability to resize images, and through doing so generating thumbnails, is of great importance to any interactive website where the users can themselves upload images. This is mainly because you average user is completely unaware of how big the image is that they are uploading. It could be 200 x 150 pixels, or 2500 x 1600, to most the dimensions would not mean much.
Click here to read on.
Posted by Garren Harland on August 23, 2009, 7:56 pm.
Web-designers have for years been longing for a simple CSS command that can produce a rounded corner effect on various HTML elements. This is because although for years a work around has existed to produce this effect (using rounded corner pictures to fake the rounded corners), most of us long for a more code elegant solution.
Click here to read on.
Posted by Garren Harland on August 23, 2009, 6:54 pm.
Thanks to CSS borders do not have to be plain things. Indeed, with the choice listed below there should be a border style suitable for ever occasion. Especially the three dimension borders are worth trying out.
Click here to read on.
Posted by Garren Harland on August 22, 2009, 12:38 pm.
Sending special characters such as plus symbols through an AJAX form to be received the other end requires a bit of trickery. Often when programmers experience trouble with this kind of transmissions there was either...
Click here to read on.
Posted by Garren Harland on August 22, 2009, 8:05 pm.
Here is a valuable trick for newbie web developers. On this page you will learn how to keep empty table rows, span and divs from collapsing on every browser.
Click here to read on.
Posted by Garren Harland on August 19, 2009, 8:19 pm.
If you are building a site indexing website that needs to scan a page's title and meta tags the PHP function get_meta_tags() is the thing that dreams are made out of. Sure, you could write a bunch of regular expressions to extract meta tags and all their information from a website. But then again you could save yourself the time and practice your gloating face instead!
Click here to read on.
Posted by Garren Harland on August 19, 2009, 4:23 pm.
To transfer all elements of an array into one string the function implode() is required. Simple specify the array that is to be imploded along with a separator.
Click here to read on.
Posted by Garren Harland on August 19, 2009, 3:26 pm.
The Message Digest Algorithm designed by RSA Data Security, Inc. can help keep your user's passwords safe, even if for instance someone was capable of obtaining the user database with your passwords in them.
Click here to read on.
Posted by Garren Harland on August 19, 2009, 2:50 pm.
In a previous tutorial I have discussed the PHP function soundex(), and how it produces a 4 digit code that can be used to compare words that sound alike, but are spelt differently (such as Weather and Whether).
Click here to read on.
Posted by Garren Harland on August 19, 2009, 2:20 pm.
Previously I have discussed how rare symbols can be encoded and decoded from or into ASCII with the PHP functions html_entity_decode and htmlentities(). And while the function htmlentities() is perfect for converting non standard symbols into their ASCII equivalents, it does not convert every symbol out there.
Click here to read on.
Posted by Garren Harland on August 19, 2009, 1:21 pm.
Because of the various symbols that a URL will and might contain, such as colons, slashes, question marks and equals, passing them along as a Get variable is not possible in their original format. Some encoding is needed to make this smooth transition possible.
Click here to read on.
Posted by Garren Harland on August 19, 2009, 12:57 pm.
When passing along a URL as a Get variable, certain symbols need to be converted into a percentage sign, and a two digit hexadecimal equivalent of the corresponding ASCII symbol.
Click here to read on.
Posted by Garren Harland on August 18, 2009, 5:23 pm.
It can happen to anyone. You are looking for one search term, but instead of spelling it correctly you use a word that sounds similar, but is spelt slightly different. For instance you might be searching for the word "Weather" but have accidentally typed the word "Whether".
Click here to read on.
Posted by Garren Harland on August 18, 2009, 4:45 pm.
This tutorial will discuss how you can calculate the similarity of two strings in PHP. The returned value will be the match percentage, ideal therefore for search functions where results only need be displayed with a 50% plus match.
Click here to read on.
Posted by Garren Harland on August 18, 2009, 2:34 pm.
Building a spell check for your PHP applications may sound like a bit of a daunting task. The question of where to start may come up, as copying word for word out of countless dictionaries would seem to be a mind numbing task at least 99.9% of all programmers would love to avoid at all cost.
Click here to read on.
Posted by Garren Harland on August 18, 2009, 1:06 pm.
Ever asked yourself what the difference is between functions that start with the term ereg and eregi? After all, both search through strings by using regular expression patterns. Both either return true or false and pass on groups in arrays of regs (ereg and eregi), or perform a replacement in the specified location without changing the original (ereg_replace and eregi_replace).
Click here to read on.
Posted by Garren Harland on August 18, 2009, 11:20 am.
The PHP function sql_regcase() is ideal for regular expression newbies, as it converts any search patter with which it is provided into something a regexp function can use to analyse strings with.
Click here to read on.
Posted by Garren Harland on August 18, 2009, 10:39 am.
If you are looking to style the links on your website with CSS congratulations! You are taking one big step towards producing professional web designs. With the help of CSS you will be able to provide your links not only with color and specified font styles, but most important of all with mouseover hover effects. One of the most important elements of a professional web design!
Click here to read on.
Posted by Garren Harland on August 17, 2009, 7:28 pm.
Sometimes a string comes along that requires more than the traditional PHP split() function. Let us say for example we had multiple conditions by which a string needed to be split up by. In some instances a mere space would be enough, yet, the string should also be split up at each comma. Here then clearly a preg_split() is required.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 6:43 pm.
Every asked yourself whether or not a symbol within a regular expression required a backslash, in order for the syntax to work? After all, there are quite a few symbols to keep track of in regards to regular expressions. Especially to programming newbies distinguishing between the two can be a daunting task.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 5:08 pm.
Although regular expressions always look impressive, and are a good way of confusing non-programmers (and some programmers) while coming across as a rocket scientists, there are some instances when regular expressions are indeed not required. And validating a date is one of them.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 4:17 pm.
Let's say you want to plan your Easter weekend for 2016. Naturally enough to do this you will require the exact date that Easter falls on. You can now do two things. Go look up the date in a calendar, or simply make use of a predefined PHP function capable of returning every Easter that has or will occur during the Unix era.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 3:33 pm.
Let's say you have a variable named path, and all that you really require is the name of the file at the end of the path. Through some bizarre combination of programming functions and code structures you have also only been left with the path, and therefore have no way of singularly accessing the files name.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 2:54 pm.
Disk space is one of those things most programmers rarely think about. Until the moment it is all used up that is! Lucky PHP has a function with the sole purpose of returning the amount of free disk space left within a specified location.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 2:18 pm.
There are numerous reasons why a HTML file upload forms may fail to work. The most common errors are found in the coding of the HTML form itself. Based on this I will go through a short checklist for you to make sure that all the required elements are present in your HTML form before claiming that your host has done something wrong.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 1:03 pm.
This is one of those annoying HTML "bugs" that is easy to solve once you know how to go about it, but if you do not it can result in a frustrating search for solutions that can last for hours.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 12:27 pm.
An un-styled table is not the prettiest sight to be found on the world wide web. This is why proper styling via CSS is highly recommended. This tutorial will therefore cover how tables can be styled, through the prevision of background and border colors, along with styling the title row so that it is recognisable as such.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 11:13 am.
Previously I have discussed how various cursor styles can be accessed via CSS. This current tutorial will go one step further, and give an insight how the cursor property can be changed to another setting dynamically once the page has already been loaded.
Click here to read on.
Posted by Garren Harland on August 17, 2009, 10:15 am.
For specific curser requirements CSS offers the property curser, which allows you to specify which type should appear when the mouse is hovered over an element. Here then is an introduction to the different types, including mouseover examples.
Click here to read on.
Posted by Garren Harland on August 13, 2009, 18:50 pm.
Previously I have discussed how an image's opacity can be set via CSS. This feature can of course also be accessed via JavaScript in order to give your website a more interactive feeling!
Click here to read on.
Posted by Garren Harland on August 13, 2009, 15:30 pm.
Most developers know that thanks to the CSS Opacity property HTML the background of HTML elements of div, span, or tables can be faded using CSS. The connection that some fail to make is that the same can be applied to images, and can potentially save a lot of time editing images in Photoshop. After all, changing a few lines of code is always quicker/easier than having to resave and upload a picture. It will also be more impressive to your boss and clients.
Click here to read on.
Posted by Garren Harland on August 13, 2009, 14:55 pm.
Thanks to CSS Box like elements (div or span tags with borders) can float above one another to cause an overlapping effect. To produce this effect the following ingredients are necessary: at least two html elements, both with defined positions so that they overlap, and a so called z-index, which indicates which element is to appear above the other.
Click here to read on.
Posted by Garren Harland on August 8, 2009, 10:38 am.
Unless you are building a gangster rap forum, chances are that at least 50% of your visitors will not be too impressed by extensive swearing within posts. This however will not stop the other users from continuing to do so.
Click here to read on.
Posted by Garren Harland on August 7, 2009, 8:41 pm.
After you have received date from a textarea, unless you convert the line breaks into
tags, the data entered will all appear in one block. Luckily enough PHP already has a function to solve this problem. No complicated regular expressions are needed to solve this one;-).
Click here to read on.
Posted by Garren Harland on August 7, 2009, 8:26 pm.
Here is how you automatically start a file download once a user enters onto a page. Note, the user of course has to be willing to download the file, and can choose not to. If you are looking to force some software onto your visitors you are in the wrong place. If instead however you are looking for a simple download on load for an install shield for instance, carry on reading.
Click here to read on.
Posted by Garren Harland on August 7, 2009, 6:03 pm.
Having problems with your JavaScript drop down menus not being able to appear over Flash files? Don't worry, you are not alone. Luckily there is a pretty easy solution to the problem, simply set the flash file to transparent.
Click here to read on.
Posted by Garren Harland on August 7, 2009, 5:24 pm.
Most browsers plain and simple have not got a clue about how to deal with mp3 files. If you link to a PDF or word document they will play along, open a new window and display the document. Not so with MP3s. On your standard Internet Explorer (yes, even on version 8), it will just try to open the MP3 as a page, and will then give you an error message as if it was your fault for trying to give it an impossible task.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 5:10 pm.
The CSS float attribute can be used for far more than simply floating an image to the right or left of your content. When used properly you can even align 3 Divs next to each other, creating newspaper like columns.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 3:20 pm.
To calculate the remainder of a subscription time in PHP we need three items: the end date from the future in timestamp format, the current date in timestamp format, and a function to convert the difference between the two into something that is actually understandable to a human who's brain can not figure out how many days are within a given thousand seconds.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 2:54 pm.
If you are looking for the value of a specific percentage of a number in PHP all you need is some basic maths. For instance, if you want to find out 5% of 100, simply multiply 100 times .05. Here are a few examples to try out.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 2:33 pm.
Here is a useful bit of code for testing whether or not a number is dividable by a specified value. In our example below we will go through a "for" loop, checking every number to see if it can be divided by 5. If yes we will print it, if not we shall skip it and go on to the next.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 12:59 pm.
Accessing the value of a HTML select box via getElementById() does not work the same way on all browsers. While the traditional getElementById value will work on Internet Explorer, Opera, and most other browsers, Netscape will not be able to interpret it and will break off the script mid function.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 10:28 pm.
On a dynamic website, such as a form, users often get the feeling they can post all kinds of dodgy images to their heart's desire. Now while most webmasters would either A. Let their visitors have their fun, or B. Go nuclear, and ban their visitors from interacting with HTML code, there is another way.
Click here to read on.
Posted by Garren Harland on August 4, 2009, 12:29 pm.
Previously I have discussed how to build a RSS feed and validate its structure. And while doing building and maintaining a RSS feed by hand is all well and good, usually they are an integral component of dynamic websites. Especially since the idea of an RSS feed is to constantly provide your readers with updates.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 6:23 pm.
This page discuses how you can trick the PHP function mktime() into returning the Unix timestamp of a date within a specified distance in the future or from the past. To first illustrate this we will use the following example.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 4:10 pm.
If you have a large dynamically generated array, you might need a function to find out if a specific element is contained within it. And the function that would come to your rescue in this scenario is in_array().
Click here to read on.
Posted by Garren Harland on August 3, 2009, 3:13 pm.
Sometimes all you need from a string are certain elements. Such an element can be a hidden number which has significance to you. Maybe a timestamp for instance.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 2:22 pm.
In Latvia Postcodes consist of two letters followed by a hyphen and four digits.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 1:56 pm.
Japan's postcodes consist of 7 digits, grouped into 3 and 4 digit cluster separated by a hyphen. Here for instance is what Chiyoda in Tokyo's Postcode looks like.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 12:24 pm.
The following function can be of significant value when used with other string manipulation functions. Although it is to be recommended that when outputting special characters in HTML, the ASCII equivalents should be used.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 11:44 am.
If you have a string that can only contains alphanumeric values, it is a lot simpler to state the type of characters that are allowed, instead of looking up every possible symbol on the planet and banning it.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 11:17 am.
When working with divisions the remainder is often required. This is often important for subsequent calculations, such as the conversion from seconds into days, minutes and hours.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 10:15 am.
Most programmers go about this task the wrong way. Or rather they only complete half the job, and then wonder why they are not getting the intended results. Usually they do something along the lines of subtracting an old timestamp from the current one, which is actually a step in the right direction, but then they get frustrated when strftime() returns them some date from the 70s.
Click here to read on.
Posted by Garren Harland on August 2, 2009, 3:31 pm.
The error message discussed on this page is frequently due to a lack of understanding of how exactly header, and header related functions work. Indeed, often it is experienced after a function such as require_once() was used, and a document is called upon which tries to send of headers that are long gone.
Click here to read on.
Posted by Garren Harland on August 2, 2009, 2:25 pm.
In order to include a dynamically created PNG file into a HTML document we will need to create a separate PHP file. This file can then be included via a simple html image tag, specifying the PNG creating file.
Click here to read on.
Posted by Garren Harland on August 2, 2009, 12:13 pm.
If your website has a file upload facility, the last thing you will want is your visitors being able to upload any file to their hearts desire. Especially the upload of executable files could put a lot of your other users at risk if they chose to download it.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 11:11 pm.
The php function filesize() will return exactly as the name indicates the size of a specified file. The following example will return the file size in a measurement of bytes.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 7:24 pm.
If you need to dynamically create a directory in PHP, mkdir() is the function that you are looking for. All that it requires is a specified path to the folder that you want to create.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 4:04 pm.
Using the function copy(), a file can be cloned to a specified destination. As the following example displays first the original file along with it's location needs to be provided, followed by a target location and name for the copied file.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 1:04 pm.
With the PHP function chmod() you can modify a folder or files read, write and execute rights. This is done by first specifying the path and folder, followed by the according octal code. Three modes can be specified for each user group.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 12:33 pm.
To return the path and name of a script with PHP the following two variables can be used. Both of them are server variables, which generally convey a lot of useful information on server details and settings.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 11:27 am.
A decision every creator of an interactive website faces, is whether or not to allow their visitors to make use of HTML code, or the extent to which they can make use of it. After all, if you give users the option of posting their own HTML messages they might go a bit over the top and post something that does not at all fit in with your layout, or could even cause errors.
Click here to read on.
Posted by Garren Harland on August 1, 2009, 10:33 am.
Cached pages are any AJAX using programmer's worst nightmare. What use is a background news feed that is reloaded every 30 seconds if it constantly displays the same cached information? Clearly a forced update is needed!
Click here to read on.
Posted by Garren Harland on July 31, 2009, 8:05 pm.
Previously I have discussed how JavaScript enables us to automatically load a new location by editing window.opener.location.href. And while this method is very useful with pages that have already been loaded, and due to a given set of specified circumstances need to change location, it is not a very elegant way of conducting a simple re-direct.
Click here to read on.
Posted by Garren Harland on July 31, 2009, 5:39 pm.
In some instances obtaining an array's variables by themselves is not enough. Sometimes the belonging keys are also required. Here then is the easiest way to output both by using the PHP array functions list() and each().
Click here to read on.
Posted by Garren Harland on July 31, 2009, 4:38 pm.
As, the title indicates this page will discuss the PHP function split(), and how it can be used in a real world application. We will use an email invite function on a website as an example.
Click here to read on.
Posted by Garren Harland on July 31, 2009, 12:25 pm.
There is a relatively unknown function called parse_url(), which is ideal for evaluating links, and separating them into individual informative components. With the query string section of the URL being one of the more intriguing part. Here is a piece of code that demonstrates how parse_url() works.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 8:03 pm.
One of the most powerful functions in php is eregi_replace(). By using this function effectively with good regular expression syntaxes you can manipulate strings to your heart's desire. On this page we will cover to simple examples as an introduction to eregi_replace(). If you have not worked with regular expressions before, you should definitely read the introduction to regular expressions tutorial before attempting the following examples.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 5:57 pm.
Since the 1st of January 1970 the Unix clock has been ticking, one second at a time. Thanks to this every programmer has one time format from which all the others can be derived. In PHP this timestamp (with the current date, time, etc) can be loaded via the function.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 5:12 pm.
Timestamps are great for the following reason. They can be converted into any chosen format without having to do much pre-converting. This saves a lot of time compared to times and dates stored in human readable formats.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 4:26 pm.
Using the PHP function date() the current date and time can displayed numerous ways. Here then is a reference guide to help demonstrate these numerous formats and their respective codes.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 1:34 pm.
Ever wanted to store every website a user has ever come through from to get an accurate picture of the origin of your traffic? While your stats tool may offer such a feature putting together your own table will give you a far more accurate insight as to where your visitors are coming from.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 11:45 am.
The following variable can come in handy if you are attempting to write your own stats tool, or if you are merely interested in what type of browsers your visitors are surfing your site with. After all, for testing sake you might come across one or two rare browsers which you did not know about, and can therefore make sure that your website does indeed work as intended.
Click here to read on.
Posted by Garren Harland on July 30, 2009, 10:28 am.
If you are relatively new to PHP and not yet familiar with the concept of classes you are truly in for a revelation. Classes make the life of a programmer about 1 gazillion times simpler, help keep your code more organised (unless you are a master of untidiness), and most importantly in larger online applications help prevent variables from clashing.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 6:31 pm.
Brazil has a nationwide scheme known as Codigo de Enderecamento Postal (CEP), which has been running since 1972 and consists of 5 digits. Thanks to economic groth however a three digit suffix has been added to the CEP since 1992. This gives Brazilian Postcodes the following format.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 3:07 pm.
To validate a South African Postcode we need to devise a Regular Expression that validates numbers from the range of 0001-9999. For elegance sake I will split the following example into two parts. First to check that the user has not entered 0000, and then to validate that indeed four digits have been entered. Here are the two regular expressions we will use.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 1:15 pm.
China's Postal codes consist of 6 digit number system which is applicable for the whole country. Since the lowest range belonging to Taiwan (000000???009999) can consist of six zeroes (although the lowest code in this regard probably has five zeroes: 000001), the resulting regular expression code is not very long. In fact all that needs to be done, is the specification that six ({}) digits ([0-9]) are required.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 11:51 am.
Indian postal index numbers are 6 digit numbers, and therefore putting together a Regular Expressions statement to validate them does not require to much work. Our statement will consist of two parts, the first consisisting of numbers ranging from 1-9, the second, consisting of 5 digits will be 0-9.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 10:59 am.
While the code below uses JavaScript to demonstrate a HTML Color Code validation, the regular expression itself should work in a variety of programming languages, including server side languages such as PHP.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 9:17 am.
Because New Zealand Postcodes are a simple 4 digit number their validation is very simple, as the following regular expressions goes to show. Note that the regular expression itself should be usable by a number a programming languages! Here is what it looks like.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 7:45 pm.
If you have recently come across the CSS visibility property you are no doubt asking yourself how to utilise it. After all, a hidden element, be it a div, span or table, is only useful if at some point you can change it's status from hidden to visible. Lucky for us web developers there is this language called JavaScript which can help us change such settings on the role.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 5:01 pm.
While putting together the following script I for the first time could appreciate what it must have been like inventing the nuclear bomb. Nothing good could come from it, but for curiosity sake, and because of the need to prove oneself the needles creation carried on being built into existence.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 3:23 pm.
People in general are not very smart when it comes to inventing passwords. It is shocking how many of us actually believe using a family members' name, date of birth, wedding date, wife or pet's name, favourite sports team, etc are secure choices!
Click here to read on.
Posted by Garren Harland on July 28, 2009, 12:36 pm.
This is a rather elegant solution for crowded websites with not much space. Particularly to place "Enter your comment here:" in front of a textarea, or "Enter Username:" before a textbox.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 11:51 am.
The effect of an image changing on mouseover can, when used moderately, turn a stylish but boring website, into a stylish interactive website. The keyword here is moderation. Don't disorientate your visitors with 1000 image dynamic image changes per page.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 10:59 am.
Dynamically swapping out the ;-), :-), :-( and other smilies shortcuts is as easy as it gets with PHP. All you need to do is perform a simple str_replace(), and in the brackets first specify the shortcut wink, and then after the comma place the image tag and files.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 10:03 pm.
Pre formatting your data at the select stage can save you a lot of time spent on editing and fine tuning. A frequent requirement in this sense is to convert a string into lower case. Here then is how it is done in MySQL.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 7:46 pm.
If this is news to you, yes, indeed, it is possible to round your numbers to a specified decimal point within a MySQL query statement. No need to use any PHP round functions afterwards, simply enjoy the results the MySQL query gives you.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 3:54 pm.
If you are looking for a way to join two fields together and through doing so creating one variable, AS is the solution. Lets use the example of joining first and last name from individual fields of a table together into becoming one simple name. Here is how it would be done.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 3:21 pm.
To perform calculations in MySQL we have to define a new (temporary) row for the results. This does not mean you have to change your table structure, instead we will dynamically generate a row on the fly, that will only be physically available in the output, not in the table it self.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 2:50 pm.
Lets assume your boss has asked you to provide the number of employees in your organisation in each of the salary categories where more than 5 employees are present. Now while finding out how many employees are in each of the salary categories is pretty straightforward.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 2:20 pm.
Here is how you can output the total sum of specific column values added up. Let's say for instance that we had an employee database, and our boss wanted to know the total sick days that had been taken off by all employees put together. Here then is how we would accomplish this task, by adding up all the individual number of sick days.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 1:55 pm.
By using count() in MySQL we can establish how many rows lie within a specified range, or fulfil a certain set of conditions.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 1:31 pm.
Establishing the smallest or largest field number within a table in MySQL requires the use of MIN() or MAX(). Within the brackets you can define the field you wish to find the largest or smallest values of. Here then is how we would find the winner and loser from a table called sportResults.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 1:14 pm.
Thanks to phpmyadmin a lot of us programmers have become spoilt. Sure we know how to put together the most complex select statements in the world, but at the cost of the simpler things. Such as creating a MySQL Table via code. Oh the horror!
Click here to read on.
Posted by Garren Harland on July 27, 2009, 12:48 pm.
Let us say you had a table called users and you wanted to put together a select statement for specifically those whose IDs fell in the rang between 30 and 40. Now most programmers would in this case resort to greater and smaller than operators.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 12:09 pm.
To make use of certain MySQL functions your tables need to be of the correct type. For a MySQL MATCH() statement to work for example, you will need table to be of the type MyISAM before it can be searched.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 11:56 am.
If you are looking to build a search engine like function for your MySQL Database then learning how to utilize MATCH() will be a step in the right direction. Match will return results with your specified keywords along with ordering them by occurrences.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 11:52 am.
Previously I have discussed how one can use a SELECT WHERE LIKE statement in combination with Wildcards to find the appropriate results of a table based on a keyword search. The next step of course is to not only find the rows that are deemed suitable enough to be included among the results, but to also order these based on the occurrences of the keywords.
Click here to read on.
Posted by Garren Harland on July 27, 2009, 11:50 am.
In MySQL you might not always be able to perform a select where you know the exact name of the entity you are looking for. Let us say for instance you have a sport articles table, and want to return every article that contains the keywords Michael, Jordan and Basketball.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 9:10 pm.
Returning the average value from the table of a field in PHP is a piece of cake. First we need the correct SQL statement, specifying the field of which we require an average. In this example we want the average score from a table called players.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 8:12 pm.
The most straight forward way to ensure your MySQL search results only have unique values is by using a distinct select query. The structure of a query using distinct is slightly different when compared to a standard select argument.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 4:54 pm.
Here a list of varous currencies signs, trademark symbols and their ASCII codes.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 11:49 am.
Building a website for a bunch of maths geeks? Then here are some ASCII Codes that might come in handy.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 11:28 am.
Here is a list of every kind of strange looking letter the heart (or in most cases rather the client) could desire.
Click here to read on.
Posted by Garren Harland on July 26, 2009, 10:24 am.
Below are 3 lists of alphanumeric symbols, including numeric values, upper and lower case letters, and their ASCII, DEC and HEX Code equivalents.
Click here to read on.
Posted by Garren Harland on July 25, 2009, 4:42 pm.
The general practice of using pop-ups as an integral part of dynamic websites has become vastly outdated in recent years. Yes, if you want to open up a new window to display another site, popups are the one and only method to use.
Click here to read on.
Posted by Garren Harland on July 25, 2009, 11:39 am.
Thanks to the GD Library Function ImageCopyResized() producing Thumbnails in PHP is not too difficult. The important part is what happens before that function to prepare the Image to be copied and resized.
Click here to read on.
Posted by Garren Harland on July 24, 2009, 3:25 pm.
Although JavaScript can be used to output the local time settings of a browser, it is hardly an accurate tool for displaying the time of various time zones. Indeed, even to work them out in JavaScript you will need to use mathematical calculations, that (taking Summer and Winter times into account) often come up with questionable results.
Click here to read on.
Posted by Garren Harland on July 24, 2009, 2:13 pm.
The JavaScript Clock that we are about to discuss will display the current time that your computer is set to. And while this method is ideal for accessing a user's local time, there are a few issues that need to be considered.
Click here to read on.
Posted by Garren Harland on July 23, 2009, 9:38 pm.
I decided to write a reference on the various list styles, and their availability on browsers such as Internet Explorer, Firefox and Opera. The revelation here is that out of the 10 styles listed below, only 5 worked on Internet Explorer (Version 8). Opera and Firefox were capable of interpreting all of them.
Click here to read on.
Posted by Garren Harland on July 22, 2009, 11:34 am.
If the function getElementById() is new to you I would suggest you read the introduction tutorial first before you attempt the following task. It could save you some debugging later on.
Click here to read on.
Posted by Garren Harland on July 22, 2009, 10:34 am.
GetElementById()'s talents are seemingly endless. While I have already discussed how this function can be used to change CSS Font Families, they can also be used to set style properties such as height, weight and font style. Here is how we can access these three properties.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 9:13 pm.
Previously I have discussed how a span or div element's font family can be changed dynamically via the JavaScript function getElementByID(). Here then is a closer look at how to set font families correctly using CSS, followed by some comparative examples that you can look at on various browsers to test what fonts are supported by which browsers.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 7:17 pm.
As I have previously written, the JavaScript Function getElementById() provides the possibility of accessing various span and div elements through their ID attributes, and to change their properties. Naturally enough these properties include CSS Font Families.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 5:59 pm.
While rounding numbers up and down to even values is pretty straight forward in JavaScript, rounding them to a specific decimal point requires a bit of trickery. Nothing complex though. You don't have to be a maths genius to figure this one out. First of let us have a look at the code used to round numbers up (or down) to even values in JavaScript.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 5:17 pm.
Previously I have discussed how additions, subtractions, multiplications and divisions can be performed using bc functions with the results being produced to a specified decimal point.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 4:57 pm.
Here are four PHP maths functions that might come in handy. If for instance you have to perform a simple addition, subtraction, division or multiplication, and want the result to be rounded to a specific decimal point, here is how you can do it.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 4:13 pm.
All the FTP functions on PHP work similar to the command based interfaces such as the cmd on windows. So if you want to upload and manipulate a specific set of files, you need to be in that exact directory.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 3:46 pm.
If you are building program for your users it goes without saying that it will need a rename function. We all have the habit of changing our minds on the names of files, folders, company names, even our own names in fact. And while ftp_rename() will not be able to change the name on your birth certificate, it can come in handy with files.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 3:05 pm.
Here is a very fast and efficient way of adding various html tags to every element in an array using the PHP function array_walk(). If you have not encountered the function array_walk() before now you are in for a treat. Here is how it works.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 2:19 pm.
One of the quickest and simplest ways to print out an array in PHP is by using the implode() function. Although it does not give you quite as much control as you may be used to from using loops, implode is ideal for situation where only a simple list is needed.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 1:49 pm.
One of the most important components of a FTP program is the ability to output the name of every item inside a folder a long with its details such as.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 12:26 pm.
If you are reading this I will assume that you are trying to access a MySQL Server from a remote host. Furthermore your remote server and your MySQL Server are not much in the mood for dancing, and no matter what you try you are confronted with this annoying error message.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 12:26 pm.
Creating a new directory for a FTP program is a piece of cake. All you need to do is establish a connection with your server, and then go on and use the following function: ftp_mkdir()
Click here to read on.
Posted by Garren Harland on July 21, 2009, 12:14 pm.
If you are writing a FTP program with PHP you will at some stage need a function to provide you with the time and date when a file was last edited or uploaded. Lucky for us PHP already contains such a function: ftp_mdtm()
Click here to read on.
Posted by Garren Harland on July 21, 2009, 11:55 am.
Before you can download a file via FTP you will need to establish a connection to your server. So in case you do not know how to establish a connection, I would suggest you read the following tutorial first.
Click here to read on.
Posted by Garren Harland on July 20, 2009, 8:50 pm.
Before you can start uploading files via FTP in PHP you need to have established a connection with your server. This requires that you specify the correct server address, username, and password.
Click here to read on.
Posted by Garren Harland on July 18, 2009, 8:46 pm.
I think the following code should be accompanied by a warning note. It would go along the lines of "Be aware, a very critical eye is needed to change scroll bars into something that resembles coolness, and does not end belonging on tacky-websites.com". The potential of someone actually using this code to actually improve the look of their website is in fact so small that Netscape has chosen not to interpret it.
Click here to read on.
Posted by Garren Harland on July 18, 2009, 6:33 pm.
Aligning a div element at the center of a document can turn into a conscientious web designer's worst nightmare. The main reason for this headache of course being that different browsers react differently to the necessary CSS commands needed to accomplish this task.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 4:08 pm.
Before menacing users can be blocked their IP-Address needs to be captured and monitored. Here is one way to do so. Create a table called visitors into which you can store IP-Addresses.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 3:21 pm.
If you are reading this page I guess you have been confronted with one of these and that you might be asking yourself why exactly the file you wish to be included is not being included. This is especially frustrated when you have finished a project on your localhost machine, proceed to upload your work with the expectancy of being able to bask in glory, only to be confronted with some annoying messages.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 11:59 am.
If you are being confronted with this error message your code probably contains an endless/or seemingly endless loop at some point. The key then is to have a closer look at each of the loops in your code and making sure that they are indeed exit-able. The line number stated at the end of the Fatal Error message should give a hint as to whereabouts your code enters its viscous circle.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 11:35 am.
The T_VARIABLE error message is usually a result of a typo, either caused by not closing off speech marks, or by having not defined a variable properly.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 11:05 am.
If you are receiving the Invalid Argument message in your JavaScript Error List it could be caused through one of the following.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 10:20 am.
While your average local development area is usually pretty lenient towards where you use the code session_start() most web hosts are not. Instead, the settings are usually set a bit stricter, and a few changes in your code are usually to be expected.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 11:17 pm.
In order to convert negative numbers into positives in PHP one simple function is required: abs(). The abbreviation abs stands for absolute values, and works like this.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 11:00 pm.
Here is a function that could come in handy with numbers games. More specifically: numbers games where the winner is the person who has guessed the closest number to an end result.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 7:05 pm.
Date of birth inputs come in various shapes and sizes. To fit these various requirements I have put together 6 different Regular Expressions for the various styles. I am sure if there is not one there to fit your required criteria you can mix and match to come up with the desired result!
Click here to read on.
Posted by Garren Harland on July 13, 2009, 5:47 pm.
Uploading multiple files in PHP is not very different from uploading a single file. The only adjustment being that instead of one variable containing the files details, the variable $userfile_name for instance would become an array.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 4:53 pm.
The amount of memory available to your scripts in PHP can be changed using one of the following three methods.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 4:23 pm.
To change your web server's file upload limits with the following lines of code you may need to request the permission to do so from your host. This should be less of a problem if your website is located on an in house server.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 1:00 pm.
This tutorial will teach you on the one hand how to convert decimal numbers into hexadecimals codes and vise versa, while at the same time having a closer look at the format of HTML Color codes.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 10:42 am.
Here is the predefined PHP function that can calculate your square routs.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 7:29 pm.
Connecting with and utilising a MySQL Database that is located on a different Server requires the same function with which connections are usually established in PHP: mysql_connect() (or mysql_pconnect).
Click here to read on.
Posted by Garren Harland on July 12, 2009, 6:42 pm.
The function array_splice() serves two purposes. On the one hand it can be used to remove certain elements from an array. Let us say for example we have an array that consists of 20 elements, using array_splice we could remove elements 10-15, turning our array into a 15 element array. Here is how it is done.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 4:16 pm.
There are two functions that can be used in PHP to return the number of elements contained in an Array.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 3:47 pm.
For this often required functionality PHP has two predefined functions to offer.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 1:12 pm.
What better way to introduce the shuffle() an array function in PHP than using a stack of cards as an example? Like a good croupier however we won't just shuffle our cards using one method. Instead we will use a batch of functions including shuffle(), array_flip(), array_reverse(), array_slice() and array_merge().
Click here to read on.
Posted by Garren Harland on July 11, 2009, 8:50 pm.
The function asin() can be used to calculate the Sinus Arch in PHP. Simply insert the value in between the brackets and let PHP take care of the rest for you.
Click here to read on.
Posted by Garren Harland on July 11, 2009, 6:58 pm.
As with most mathematical requirements PHP already has a function in place to help deliver your results. And even for Cosine Arch calculations PHP is not a let down.
Click here to read on.
Posted by Garren Harland on July 11, 2009, 6:15 pm.
PHP has the constants mentioned in the title and others already predefined. All you need is the right code to access them by!
Click here to read on.
Posted by Garren Harland on July 11, 2009, 5:38 pm.
Are you tired of having to type [a-zA-Z0-9] every time you want your regular expressions to look for alphanumeric symbols? Then you are not alone! Thankfully an alternative method exists to address various shapes and forms of symbols in regular expressions.
Click here to read on.
Posted by Garren Harland on July 11, 2009, 2:48 pm.
First of all, to change the height and width properties of a table or div element with getElementById() you will need to ensure that each of the HTML tags that you plan on becoming dynamic, have a unique ID attribute. The importance of this is highlighted in the example at the bottom of the page, where id1 is the defined ID for the example table, and id2 for the Div.
Click here to read on.
Posted by Garren Harland on July 11, 2009, 1:08 pm.
Do you want to change font colors of div, span and table elements using JavaScript? Then here is the code that you have been looking for.
Click here to read on.
Posted by Garren Harland on July 10, 2009, 4:35 pm.
One of the easiest ways to change a HTML element's background property is using JavaScript's getElementById() function. As previously discussed in other tutorials getElementById() accesses individual HTML tags by their defined ID tags, and through doing so allows various properties to be changed via JavaScript.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 8:01 pm.
I have previously discussed how to change the content of span or div tags by using getElementById and innerHTML. As you might be aware, getElementById() can do far more than just change content. Indeed it can access and manipulate a tag's style components. This tutorial will specifically focus on how you can manipulate borders by using JavaScript.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 6:41 pm.
Ever asked yourself why html elements have ID tags? You might be aware that they can be used to style an element with CSS, but using Classes makes far more sense most of the time. Especially since ID tags cannot be duplicated under any circumstances. But why not? Well, here is (at least one reason) why ID tags have to remain unique.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 2:50 pm.
To change any element within a HTML document using JavaScript we need the element's correct path. Here is how we can access input fields using JavaScript.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 2:09 pm.
A good JavaScript popup statement consists of the following three components.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 1:12 pm.
So you want to close a popup with JavaScript? Then you are about to embark on one of the most challenging quests of your programming career. Or not. As far as programming goes it does not get much more simple and straightforward than this.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 12:42 pm.
As mentioned in a previous tutorial parent window and their elements can be accessed with window.opener. Here then is a more in depth view into some of the possibilities provided by this code.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 10:56 am.
The JavaScript code to access parent windows elements is not a complex one. Indeed, all that is needed is the code window.opener. The rest of the element can be addressed as per usual.
Click here to read on.
Posted by Garren Harland on July 7, 2009, 7:23 pm.
There are two ways to build a regular expression to validate Australian Post Codes. There is the easy way which will check that at least the format is right, and then there is the hard way to make sure the postcode entered is within the correct postcode range following the state abbreviation code.
Click here to read on.
Posted by Garren Harland on July 7, 2009, 12:51 pm.
Since US Zip Codes consist of numeric values they are pretty simple to validate with regular expressions. What is important is that the Zip + 4 format is taken into account.
Click here to read on.
Posted by Garren Harland on July 7, 2009, 12:03 pm.
Here is a tutorial for those of you wishing to validate SWIFT and BIC Codes using JavaScript by using Regular Expressions. I have already written a similar tutorial on how to validate SWIFT and BIC Codes in PHP, and for a detailed explanation of what components the code consists of I suggest your read the intro section of that tutorial first.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 6:40 pm.
BIC and SWIFT codes have a pretty simple format, and are therefore not that difficult to validate with PHP using regular expressions. Indeed, before we look into the regular expression itself, let us have a look at the build-up of a SWIFT/BIC Code. We will use the Swiss bank UBS' Code as an example: UBSWCHZH80A.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 4:32 pm.
Here is a function that can be used to validate UK Postcodes using PHP and Regular Expressions. This code is a prime example of Regular Expressions method of validating a string from left to right. For instance, if AA99 is not checked for before AA9, our validation function would simply accept AA9 and would ignore any postcodes containing two numeric values at the end.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 3:51 pm.
Need to validate your website users' UK Postcodes? Here's how it is done using regular expressions in JavaScript. When constructing regular expressions it is always important to remember that they compare strings from left to right. So in this case, we want AA99 to be tested before AA9.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 2:36 pm.
Here is how you find out if the current year is a leap year with PHP. The code date("L") will either return a 0 if it is not currently a leap year, or a 1 if it does happen to be one.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 1:22 pm.
Are you tired of having your forum bombarded with spam? Then you might be interested in the code below. It first generates a random code, which is then converted into a PNG picture. Just embed the picture into your site and check to see if your new users/forum posters have entered the correct code.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 10:48 am.
The following peace of code can be useful in the following two situations: 1.When a user of your site has reset their password. 2. When a user registers with your site and initially cannot choose their own password. Those are two situations within which this password generator can be used. It produces passwords consisting of random letters and numbers. Any recognisable words would therefore be a coincidence. And indeed meaningless passwords are the most secure type of passwords, when compared to sports teams or wife’s name and date and birth type passwords.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 9:47 pm.
If you are like me you probably once upon a time spotted that PHP had a random number generating function called rand(), decided to save it to your memory, and left it at that. After all, a random number is a random number. Why would a programming language need more than one random number generating function?
Click here to read on.
Posted by Garren Harland on July 4, 2009, 8:57 pm.
Producing pi in PHP is even simpler than printing Hello World.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 8:42 pm.
Previously I have written about the PHP function bindec(), and how it can convert a binary code into a decimal number. By reversing the function the opposite can be done, so changing bindec() into decbin() allows us to convert decimal numbers into binary code.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 8:16 pm.
With the function bindec() you can translate a binary number into a decimal. Not that the largest convertible number (saved as a string) consists of 31 ones. This number equals the decimal value of 2147483647.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 6:51 pm.
Do you want your users to automatically scroll to the same location after a page reload? Then here is one of the solutions you have been looking for. Most modern websites now employ Ajax where there is really no need for a page reload/auto scroll, but I guess the need for this function could still be found. Plus the code below shows you how to automatically scroll to specific location within your page.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 5:10 pm.
Looking for a PHP function to give you the greatest Common Divisor of two numbers? Then look no further. Although PHP does not as of yet provide such a function itself in its array of maths functions you can write a Greatest Common Divisor function yourself.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 1:13 pm.
Are you in need of a PHP function that rounds numbers up to the closest integer? Then the function ceil() is your solution! Just insert the number that you need rounding up in between the brackets.
Click here to read on.
Posted by Garren Harland on July 3, 2009, 8:50 pm.
Do you need a PHP function to round down numbers down to the closest integer? Then floor() is the function you are looking for! To utilise the function insert the number that you need rounding down in between the brackets.
Click here to read on.
Posted by Garren Harland on July 3, 2009, 12:50 pm.
As the title indicates, this tutorial will teach you how to validate a website URL using JavaScript. This method has a few advantages over validating a website URL using PHP, as the validation process takes place within the browser, meaning no server request or reload is necessary.
Click here to read on.
Posted by Garren Harland on July 2, 2009, 7:07 pm.
Since you are reading this article I will assume that you already know what AJAX is and how it works. You are probably either planning to build a website using AJAX, or have already built a site and are curious as to why your pages are not being indexed in Google.
Click here to read on.
Posted by Garren Harland on July 2, 2009, 11:43 pm.
As the title indicates, this tutorial will teach you how to validate an email address using JavaScript. This method has a few advantages over validating an email address using PHP, as the validation process takes place within the browser, meaning no server request or reload is necessary.
Click here to read on.
Posted by Garren Harland on July 1, 2009, 11:43 pm.
Removing duplicated values from an Array in PHP is simple. The function that we will be using to accomplish this task is: array_unique().
Click here to read on.
Posted by Garren Harland on July 1, 2009, 11:01 pm.
If you are working with PHP and MySQL, sooner or later you will no doubt require the id of an item you have just inserted into a table. Now, instead of having to perform an elaborate select statement to acquire the inserted items ID, there is a far more elegant solution.
Click here to read on.
Posted by Garren Harland on June 30, 2009, 3:41 pm.
If you have a website which regularly publishes new content and articles you might be interested in making use of RSS technology. Indeed a lot of people follow RSS feeds to constantly stay up to date with the latest information from their favourite sites, without having to surf around and check what is new. Here is a basic tutorial on how you yourself can set up an RSS feed and benefit from this technology!
Click here to read on.
Posted by Garren Harland on June 30, 2009, 3:41 pm.
If you are working on more than one website at a time you might want to set up multiple virtual hosts on your machine. So that for instance website #1 is available through www.website1.int, and website #2 is available through www.website2.int.
Click here to read on.
Posted by Garren Harland on June 29, 2009, 12:27 pm.
Now while some might still be reading the title and asking themselves why on earth anyone would want to use PHP to gather data from a Microsoft Access Database, in the real world this type of functionality does make sense. Not using Access as a Database for a website of course. But it could well be that a company has stored a lot of data locally on an Access Database, and that the data is needed for the company's new website. Any programmer faced with this kind of task will thank his lucky stars that PHP is capable of hooking up with an Access database, and through this can load the data in question over to a MySQL, or other, more suitable database.
Click here to read on.
Posted by Garren Harland on June 29, 2009, 10:42 am.
A regular expression is a search a search pattern, that analyzes a string from left to right. Most symbols within a regular expression merely represent themselves, but there are a few that have specific meanings and cause the search pattern to act in a certain way.
Click here to read on.
Posted by Garren Harland on June 28, 2009, 2:42 am.
Ever wanted to jump to another section within your code? The goto operator included in PHP 5.3 gives you just that option. Note that this goto operator is not unrestricted. The target lable that you wish to jump to much be within the same function and file. You cannot jump out of a function, or indded leap into one. Jumping into a loop or switch is also not possible.
Click here to read on.
Posted by Garren Harland on June 27, 2009, 11:53 am.
When converting and manipulating data, whitespaces play an important role. Especially databases can fill up fields with the required number of empty spaces, which can lead to undesired effects in regard to sort functions. This is why the following three functions are of particular high value.
Click here to read on.
Posted by Garren Harland on June 26, 2009, 7:30 pm.
Do you need to validate user emails for your website? No problem. Here's how it is done using regular expressions.
Click here to read on.
Posted by Garren Harland on June 25, 2009, 2:27 pm.
If you are reading this I assume you have already familiarised yourself with HTML. You are probably at a stage where you want to take your designs to the next level, and learn some of the techniques that the professional webdesigners use. Learning how to utilize Cascading Style Sheets is a first step in the right direction.
Click here to read on.
Posted by Garren Harland on June 23, 2009, 3:19 pm.
Want to add a background image to your HTML elements using CSS? Then you have come to the right place! Here is an example of CSS code that you can give to your html, body, div or table tags to provide them with a background image!
Click here to read on.
myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com