Thanks to advanced CSS properties, such as gradients and shadows, it’s now quite easy to turn a dull web form into something beautiful – with minimal effort. I’ll show you how in today’s tutorial! Our Final Product Subtle background gradients give depth to the fields while shadows lift them from the page. Even more impressive is that [...]
Continue reading...onsdag, marts 3, 2010
Kommentarer slået fra
In this tutorial we’ll be retrieving data from form fields. To do this we’ll first create an example form. We’re using the POST method to send the form data in the first example. Will later explain what this means, and how we can then retrieve the data from the form fields. Also the GET method [...]
Continue reading...onsdag, marts 3, 2010
Kommentarer slået fra
Assumptions You have an HTML form with a variety of inputs. The action attribute of the form points to a PHP file that contains the code below. Notes about code This code starts by creating an array that holds the name of various inputs being submitted via a POST. getFormData() is then called, where the required fields are [...]
Continue reading...onsdag, marts 3, 2010
Kommentarer slået fra
1) Function for stripping out malicious bits <?php function cleanInput($input) { $search = array( '@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments ); $output = preg_replace($search, '', $input); return $output; } ?> 2) Sanitization function Uses the function above, as well as adds slashes as [...]
Continue reading...torsdag, februar 25, 2010
Kommentarer slået fra
As CSS3 rolls out around the web, it is bringing some interesting new presentational techniques along with it. Today, we’ll review the basics of using CSS3 transitions and animations to add an extra layer of polish. Tutorial Details Program: A web browser that can utilise CSS3 transistions (Chrome or Safari) Language: CSS Difficulty: Easy Estimated Completion Time: 30 min Step [...]
Continue reading...torsdag, februar 25, 2010
Kommentarer slået fra
This snippet presupposed an HTML form with and ID of “age-form” and three inputs (text or select) with the IDs “day”, “month”, and “year” respectively. $("#age-form").submit(function(){ var day = $("#day").val(); var month = $("#month").val(); var year = $("#year").val(); var age = 18; var mydate = new Date(); mydate.setFullYear(year, month-1, day); var currdate = new Date(); currdate.setFullYear(currdate.getFullYear() [...]
Continue reading...torsdag, februar 25, 2010
Kommentarer slået fra
We often need to use a randomly generated number for certain situations; using Math.random() * n will usually do the trick, but it will only calculate a number from 0 to n. What if we need a number that doesn’t give 0 as the minimum value? How can you generate a random number between 100 [...]
Continue reading...torsdag, februar 18, 2010
Kommentarer slået fra
It’s very important to secure your data in PHP correctly. Because if you don’t, your website is in risk of being harmed by SQL injections and other dangerous code injections, which you obviously don’t want. So to protect your website against these code attacks, this tutorial was written ;) This tutorial will explain the reasons to [...]
Continue reading...torsdag, februar 18, 2010
Kommentarer slået fra
MooTools is one of the most flexible, modular, and well written JavaScript frameworks available. So many people use it but many of them don’t optimize their code. This post will provide you with fifteen simple tips for making your MooTools code shorter, faster, and stronger. 1. Create Your Own MooTools Build or Pull From Google AJAX [...]
Continue reading...tirsdag, februar 16, 2010
Kommentarer slået fra
In this tutorial we’ll be creating a system which will convert messages including text smilies into messages including icon smilies ( text => smilie icons ). Preknowledge For this tutorial it’s prefered that you’ve got some preknowledge about php variables, arrays, functions and the foreach loop. If not, I’d recommend you to have a look at the [...]
Continue reading...
onsdag, marts 3, 2010
Kommentarer slået fra