Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Member #
    29276
    I am decent with web design overall but I am stumped with trying to make a two column volunteer script. First I tried using a table format to accomplish it but it adds a line at the end of the script: http://www.dekarmedia.com/sco/volunt...teer-form.html

    Then I tried accomplishing it by using two columns and the layout comes out nice however after I submit the form, the right side of the volunteer script is shown on the page still, with the thank you message. (I have attached a picture of what the page looks like after the submission)

    http://www.dekarmedia.com/sco/volunteer/test.html

    Any suggestions?

    Thanks,

    Danny
    Attached Images Attached Images

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    If you have PHP on your page, and it seems you do since you are processing the form by using <?php include 'process-form.php'; ?> , your volunteer-form.html file should have a PHP extension rather than an HTML extension.

    As far as the layout still having the right column showing after the form is submitted, I'd have to see the process-form.php code. This issue may be solved by using a redirect to a specific "thank-you" page, rather than just writing to the same page after the form is filed out, or there could be a simpler way of doing it.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  4. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Member #
    29276
    Thank you for replying, I know the page should be a php extension however when I saved it as html it still allows the request to be sent so that's why I left it in .html. Same as my search script. So since both work in the html extensions should I bother changing the pages to php? If so it wont really be an issue to change all 20+ pages. I have attached the process form. It is not the modified one for the volunteer application but it is exactly the same as the volunteer process-form besides the different fields for the user to fill out.

    Thank you again,

    Danny

    PHP Code:
    <?php
      
    /** CONFIGURATION OPTIONS
    * $email_address = The email address that all form submissions will be sent to
    * $company_address = The destination address that will be used in the contact form */

    $email_address 'fakeemail@gmail.com';
    $company_address 'blah blah';
        
    echo 
    "<script>var companyAddress = '".$company_address."';</script>";

    $field_rules = array(
        
    'name' => 'required',
        
    'email' => 'required|valid_email',
        
    'phone' => '',
        
    'contact_reason' => 'required',
        
    'message' => 'required'
    );
     
    $error_messages = array(
        
    'required' => 'This field is required',
        
    'valid_email' => 'Please enter a valid email address'
    );
     
    $error_list '';
     
    $fields $_POST;
      
    if (!empty(
    $fields))
    {
        
    //Validate each of the fields
        
    foreach ($field_rules as $field => $rules)
        {
            
    $rules explode('|'$rules);

            foreach (
    $rules as $rule)
            {
                
    $result null;

                if (isset(
    $fields[$field]))
                {
                    if (!empty(
    $rule))
                        
    $result $rule($fields[$field]);

                    if (
    $result === false)
                    {
                        
    $field_name ucwords(implode(' 'explode('_'$field)));

                        
    $error_list .= "<div class='error'>$field_name: " $error_messages[$rule] . "</div>";
                    }
                }
            }
        }

        if (empty(
    $error_list))
        {
            
    $subject '[Contact Form] New message from ' $fields['name'] . '.';

            
    $content $fields['name'] . " sent you a message from your contact form:\r\n\n";
            
    $content .= "-------\n" $fields['message'] . "\r\n\n";
            
    $content .= "Contact Reason: " $fields['contact_reason']
                    . 
    " \n\nEmail: " $fields['email']
                    . 
    " \n\nPhone: " $fields['phone'] . " \n\n";

            if (
    mail($email_address$subject$content"From: " $fields['email'] . "\r\nReply-To: " $fields['email'] . "\r\nReturn-Path: " $fields['email'] . "\r\n"))
            {

                echo 
    "<h2 class='success'>Message Sent</h2>";
                echo 
    "<br/><p class='success'>Thank you <strong>" $fields['name'] . "</strong>, your message has been submitted and someone will contact you shortly.</p>";
            }
            else
            {

                echo 
    'ERROR!';
            }
        }
    }

    function 
    required($str$val false)
    {

        if (!
    is_array($str))
        {
            
    $str trim($str);
            return (
    $str == '') ? false true;
        }
        else
        {
            return (!empty(
    $str));
        }
    }

    function 
    valid_email($str)
    {
        return (!
    preg_match("/^(?!(?:(?:\\x22?\\x5C[\\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\\]))$/iD"$str)) ? false true;
    }

  5. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    5
    Member #
    29276
    Solution Fixed. I moved the message div class up within the frame of the page. I also corrected a /div that was there by mistake. Now my volunteer page works correctly! Thanks for your help!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:36 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com