HTML


  • (HTML) Form element arrays

    Sometimes you might want to group form elements in arrays. Here’s a way to do that: [html] <form> <input type="text" name="textboxes[]"> <input type="text" name="textboxes[]"> <input type="text" name="textboxes[]"> </form> [/html] The structure of the $_POST array will then be: [php] Array ( [textboxes] => Array ( [0] => value 1 [1] => value 2 [2] =>…

  • CSS3 box shadow

    A nice feauture in CSS3 is the box-shadow. Instead of working with tedious PNG-images you can add shadows to any element with the CSS property box-shadow. The syntax works like this: box-shadow: <offset-x> <offset-y> <blur> <spread> <color> <inset> The offset settings will set the angle of the shadow. Where it will be cast in relation to…

  • Super simple navigation menu

    Here is a super simple navigation bar. Customize it for your site, with colors and fonts. This is just a super simple base recipe: First the html: [code language=”html”] <ul class="menubar"> <li><a href="#">hem</a></li> <li><a href="#">info</a></li> <li><a href="#">tjänster</a></li> <li><a href="#">kontakt</a></li> </ul> [/code]

  • (PHP) Simple gallery with thumbnail generation

    This is an enhanced version of this It’s a VERY simple php gallery. You could develop it in any direction. This one only supports jpg, but that could be augmented as well. Here’s what it does: Allows the user to choose an image and enter a title (or caption). Uploads the image to a folder…

  • (PHP) Simple e-mail contact form.

    A simple contact form, just for reference. Will add more info later on… [php] <?php if (isset($_POST[‘submit’])) { $name = $_POST[‘name’]; //name of sender $email = $_POST[’email’]; //e-mail of sender $email = stripslashes($email); $subject = $_POST[‘subject’]; //e-mail subject $subject = str_replace(array("\r\n","\r","\n"), "", $subject); //remove any linebreaks to keep from code injections $message = $_POST[‘message’]; //…

  • Hide elements with radio buttons

    Sometimes you want to show or hide certain elements of a form, depending on the selection of a radiobutton.   I am by no means any javascript ninja, but this is one simple way I came up with:  This could apply to any element. For example, you could put a whole bunch of elements in…

  • Hide elements with checkbox

    This is a slightly edited version of this post. Just to make it work with a checkbox instead of radio buttons.     [html] <html> <head> <script type="text/javascript"> function DisplayElement(checked) { if (checked) { document.getElementById(‘text’).style.display = ”; } else { document.getElementById(‘text’).style.display = ‘none’; } } </script> </head> <body> <form name="form"> <input type="checkbox" onclick="DisplayElement(this.checked)" checked/> <input…