DHTML
  Home arrow DHTML arrow Page 2 - A Basic Method for Building Noisy Images
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DHTML

A Basic Method for Building Noisy Images
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-05-14

    Table of Contents:
  • A Basic Method for Building Noisy Images
  • Creating a simple contact form
  • Defining a simple PHP script
  • Completing the creation of a noisy image

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    A Basic Method for Building Noisy Images - Creating a simple contact form


    (Page 2 of 4 )

    A good place to start demonstrating how to include a simple noisy image into a web site is by creating a typical contact form where users are asked to fill in the corresponding fields with basic information, such as first and last names and an email address.

    Basically, the visual appearance that I plan to give to this sample contact form containing a basic noisy image is depicted by the screen shot below:

    As you can see, the previous web form contains a few common input boxes for entering basic user data. It also includes a four-digit random value, which is displayed in front of a simple noisy background. In this case, I decided to create a simple pattern, like the one shown below, to build the image in question; as you know, the background can be easily modified with your favorite image editing software.

    This being said, here the pattern that I used to build the previous noisy image:

    Quite simple to create, right? Now that you know how to build the background that comprises the noisy image that you saw before, please examine the signature of the following (X)HTML file. It is responsible for displaying the pertinent contact form. Its definition is as follows:

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Example using simple noisy image</title>
    <style type="text/css">
    body{
      
    padding: 0;
      
    margin: 0;
      
    background: #fff;
    }

    h1{
      
    font: bold 16px Arial, Helvetica, sans-serif;
      
    color: #000;
      
    text-align: center;
    }

    textarea{
      
    width: 250px;
      
    padding: 2px 0 2px 0;
      
    font: normal 11px Verdana, Arial, Helvetica, sans-serif;
      
    color: #000;
      
    border: 1px solid #999;
    }

    #formcontainer{
      
    width: 35%;
      
    padding: 10px 100px 10px 10px;
      
    margin-left: auto;
      
    margin-right: auto;
      
    background: #eee;
      
    border: 1px solid #999;
    }

    #formcontainer p{
      
    font: bold 11px Tahoma, Arial, Helvetica, sans-serif;
      
    text-align: right;
    }

    .challengevalue{
      
    display: block;
      
    float: right;
      
    width: 230px;
      
    padding: 7px 9px 7px 10px;
      
    margin: 10px 0 20px 0;
      
    background: #fff url(noisy_image.gif) left center repeat-x;
      
    font: bold 20px Arial, Helvetica, sans-serif;
      
    color: #039;
      
    text-align: center;
      
    border: 1px solid #999;
    }

    .inputbox{
      
    width: 250px;
      
    padding: 3px 0 3px 0;
      
    font: normal 11px Verdana, Arial, Helvetica, sans-serif;
      
    color: #000;
      
    border: 1px solid #999;
    }

    .formbutton{
      
    width: 80px;
      
    padding: 3px 0 3px 0;
      
    font: bold 11px Verdana, Arial, Helvetica, sans-serif;
      
    color: #000;
    }
    </style>
    </head>
    <body>
      
    <h1>Example using simple noisy image</h1>
      
    <div id="formcontainer">
        
    <form action="check_data.php" method="post">
          
    <p>First Name <input type="text" name="fname" title="Enter your first name" class="inputbox" /></p>
          
    <p>Last Name <input type="text" name="lname" title="Enter your last name" class="inputbox" /></p>
          
    <p>Email <input type="text" name="email" title="Enter your email address" class="inputbox" /></p>
          
    <p>Enter the four-digit code shown below:</p>
          
    <p><span class="challengevalue">Noisy image goes here</span></p>
          
    <p><input type="text" name="challenge" title="Enter the code shown above" class="inputbox" /></p>
          
    <p>Enter the text of your message:</p>
          
    <p><textarea name="message" title="Enter the text of your message here" rows="10" cols="10"></textarea></p>
           
    <p><input type="submit" name="send" value="Send Data" class="formbutton" /></p>
         
    </form>
       
    </div>
    </body>
    </html>

    As illustrated above, the markup and the CSS styles that display the previous contact form are indeed very easy to follow, so I won't bore you explaining how they work. Instead, I'd like to move on and show you how to develop a simple PHP script on the web server, which will be responsible for displaying a four-digit challenge value in front of the noisy background that was shown a few lines above.

    Want to see how this simple PHP application will be developed to generate basic noisy images? Keep reading, please.

    More DHTML Articles
    More By Alejandro Gervasio


       · Over the course of this first part of the series, a CSS-based noisy imagen mechanism...
       · The script contains the CAPTCHA value in the source. Therefore they will not stop...
       · Thank you for your comments on my article. Yes, as I expressed in the article, the...
     

    DHTML ARTICLES

    - Text-Justify, Volume, and Other Style Sheet ...
    - Ruby-Position, Size, and Other Style Sheet P...
    - Padding, Pages, and More Style Sheet Propert...
    - Marks, Orphans, and More Style Sheet Propert...
    - Layouts, Margins, and Other Style Sheet Prop...
    - Floats, Fonts, and Other Style Sheet Propert...
    - Color, Filters, and Other Style Sheet Proper...
    - Borders and More with Style Sheets
    - Learning Style Sheet Properties
    - Style Sheet Property Reference
    - Completing a Noisy Image Application
    - An Object-Based Approach to Building Noisy I...
    - A Basic Method for Building Noisy Images
    - Adding More Features to Sliders with the Scr...
    - Using Sliders with the Scriptaculous Framewo...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT