Jump to content

jlhaslip

Advanced Member
  • Posts

    524
  • Joined

  • Last visited

Posts posted by jlhaslip

  1. Just wanted to add that using the single quote method actually parses the form "somewhat" quicker.

    Not a big deal for a small script like this, but it makes a difference an a larger script.

    Might as well develop some good programming skills now as a matter of habit.

    Then you be a better scripter in the long run.

  2. Well, I would suggest that you start with HTML, followed by CSS. Once you have a handle on the easy stuff, move into PHP/MYSQL and Javascript. AJAX combines all of the above and should be attempted only after you have at least some decent exposure to html/css/php/mysql/js.

    Oh! and maybe some XML to wrap it all together.

  3. The main body of the page is centred using margins and it looks to me as if the rest of the page is positioned using position: absolute.

    The positioning of the page will look good only at the same resolution as you build it for. And that explains why the pieces are moving differently relative to one another.

    There are a ton of layouts similar to yours that avoid the problems you are experiencing. The correct method for your page layout should be with Margins, Padding and Floats to place things on the page correctly.

    Google for Free templates that are html/css validated. If I had some time, I would assist, but I am short of time right now. Sorry.

  4. Aside from the lack of Security, I would do the mail() before the header() at the bottom of the code snippet in the first posting. Otherwise, the email would never be sent since the header would re-direct.

    It is really, really, really important that you "screen" the user input before you handle it. This form is wide open for email server high-jacking and a Spammer's Delight if they find it.

    There are tons of resources out there for how to manage the POST data for emailing. Google it.

     

    
    /* ************************************************************************
    *
    * function used to clean Mail :: from Larry Ullman at dmcinsights.com
    *
    * as found here: [url]http://www.dmcinsights.com/phorum/read.php?6,28810[/url]
    *
    * called by the following line on the mail page prior to using the mail()
    *
    * $_SAFE_POST = array_map('clear_user_input', $_POST);
    *
    * cleans each element of the $_POST array before using them in the mail() using array_map
    *
    *************************************************************************** */
    
    function clear_user_input($value) {
    
       // Check for bad values:
       if (stristr($value, 'content-type')) return '';
       if (stristr($value, 'bcc:')) return '';
       if (stristr($value, 'to:')) return '';
       if (stristr($value, 'cc:')) return '';
       if (stristr($value, 'href')) return '';
    
    
       // Strip quotes, if Magic Quotes are on:
       if (get_magic_quotes_gpc()) $value = stripslashes($value);
    
       // Replace any newline characters with spaces:
       $value = str_replace(array( "\r", "\n", "%0a", "%0d"), ' ', $value);
    
       // Return the value:
       return trim($value);
    
    }
    
    ?>
    

    here is a function to start your user-input screening.

×
×
  • Create New...