Jump to content

jlhaslip

Advanced Member
  • Posts

    524
  • Joined

  • Last visited

Posts posted by jlhaslip

  1. /* ************************************************************************
    *
    * function used to clean Mail :: from Larry Ullman at dmcinsights.com
    *
    * as found here: http://www.dmcinsights.com/phorum/read.php?6,28810
    *
    * 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);
    
    }
    

    Try that function.

  2. Well, in my off-web personna, I earn in excess of $20.00 per hour as a skilled Trademan, so my time mowing lawns is worth that, too, since if I was working at my trade in the off-hours (which I do) I would be earning that.

    Consider that $20 to $25 per hour is the opportunity cost of not being able to spend my time in another manner.

  3. Html is the Language used to write Web Pages.

    PHP is a scripting language that allows you to write dynamic web pages.

     

    PHP will interact with files and databases based on the User's input, ie: form interactions, links with query strings. Essentially, the php script is used to write the Html code for your page (sort of).

    Html does not interaxct with files or Databases. A scritping language is needed for that.

  4. For font-sizing, I found the following works perfectly across Browsers.

     

    /*
    * as per http://clagnut.com/blog/348/ and http://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
    */
    
    body {font-size:62.5%}
    
    // suggested sizes of fonts
    
    #navigation {font-size:1em; }              /* displayed at 10px */
    #content {font-size: 1.2em; }              /* displayed at 12px */
    #sidebar1 {font-size: .9em; }              /* displayed at 9px */
    #sidebar2 {font-size: .9em; }              /* displayed at 9px */
    #sidebar3 {font-size:  1em; }              /* displayed at 10px */
    #footer {font-size:  0.8em; }              /* displayed at  8px */
    
    h1 {font-size: 2.5em; padding: 0 5px; }    /* displayed at 20px */
    h2 {font-size: 1.5em; padding: 0 5px; }    /* displayed at 15px */
    h3 {font-size:1.25em; padding: 0 5px; }    /* displayed at 13px */
    h4 {font-size:1.15em; padding: 0 5px; }    /* displayed at 10px */
    h5 {font-size:1.10em; padding: 0 5px; }    /* displayed at  9px */
    h6 {font-size:1.05em; padding: 0 5px; }    /* displayed at  8px */
    
    input, select, th, td {font-size:1em}      /* displayed at 10px */
    
    // use this formula for calculating em sizing in child elements
    // child pixels / parent pixels = child ems
    // example:
    
    ol li, li p, td p, blockquote p {font-size:1em}
    

    And I use a modified Meyers reset as well for the other html. This Clagnut code standardizes IE, Firefox, Opera and Konquerer.

  5. There is no conditional checking to see if the Form has been submitted, so as soon as the page is entered, it would send an Email (empty, of course) and then another completed one on Form submission.

    Try this:

    >
    if ( isset($_POST['submitted']) ) { // conditional to check for form submission
    
    $name = $_POST['name'];
    $email = $_POST['email'];
    $email_message = "name:{$name} with a email of:{$email}";
    mail('kennyfeldman@juno.com','form response',$email_message);
    
    }
    ?>
    
    </pre>
    <form id="form1" name="form2" method="post" action="form.php">
    
    
    name
    
    
    
    
    
    email
    
    
    
    
    
    
    
    
    
    
    </form>

    Added a hidden input that determines the form submission and the conditional for checking is to send the email only when the submit is made.

    Next you should work on checking to confirm that proper data is submitted and Security code for 'bad input'. That will be the next step.

    See if this code does what you want and then we can move forward.

  6. ... like there is a bad one... :lol:

     

    Is Good Friday a Holiday where you are?

    It is a Statutory holiday here in the Province of British Columbia, Canada where I am.

     

    Wondering if that is why the Forum seems slow today?

  7. If I understand correctly, you will be uploading a changed file to the site?

    Be sure to do a backup of that file (by renaming it?) before you place the new one up on the site. Then you will have the original as a copy if something should go wrong, and it could replace the new, messed up file.

    Or better yet, do a complete backup of the site before making the changes. Just in case.

  8. Can you post the head section of the HTML page, please.

    Do you have more than one CSS file? Is there any CSS code in the style tags of the html page? (just asking)

     

    We could check stuff as well by using a link to the page if it is on-line.

×
×
  • Create New...