Help with JS form, PHP Contact Form....

I originally posted this in another area, but had no luck...
I'm having trouble with a template that I downloaded (from Template Monster). My contact form shows "submitted", but I get no email.  I will submit my coding below & see if someone can help... My JS.forms is in a "JS" sub-folder in the main directory and my index.html and MailHandler.php/ashx files are in the main directory.
MailHandler.php --
<?php
    $owner_email = $_POST["owner_email"];
    $headers = 'From:' . $_POST["email"];
    $subject = 'A message from your site visitor ' . $_POST["name"];
    $messageBody = "";
    if($_POST['name']!='nope'){
        $messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
        $messageBody .= '<br>' . "\n";
    if($_POST['email']!='nope'){
        $messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
        $messageBody .= '<br>' . "\n";
    }else{
        $headers = '';
    if($_POST['state']!='nope'){       
        $messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
        $messageBody .= '<br>' . "\n";
    if($_POST['phone']!='nope'){       
        $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
        $messageBody .= '<br>' . "\n";
    if($_POST['fax']!='nope'){       
        $messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
        $messageBody .= '<br>' . "\n";
    if($_POST['message']!='nope'){
        $messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
    if($_POST["stripHTML"] == 'true'){
        $messageBody = strip_tags($messageBody);
    try{
        if(!mail($owner_email, $subject, $messageBody, $headers)){
            throw new Exception('mail failed');
        }else{
            echo 'mail sent';
    }catch(Exception $e){
        echo $e->getMessage() ."\n";
?>
JS Form --
//forms
;(function($){
    $.fn.forms=function(o){
        return this.each(function(){
            var th=$(this)
                ,_=th.data('forms')||{
                    errorCl:'error',
                    emptyCl:'empty',
                    invalidCl:'invalid',
                    notRequiredCl:'notRequired',
                    successCl:'success',
                    successShow:'4000',
                    mailHandlerURL:'MailHandler.php',
                    ownerEmail:'I have Client's Email Here',
                    stripHTML:true,
                    smtpMailServer:'localhost',
                    targets:'input,textarea',
                    controls:'a[data-type=reset],a[data-type=submit]',
                    validate:true,
                    rx:{
                        ".name":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},
                        ".state":{rx:/^[a-zA-Z'][a-zA-Z-' ]+[a-zA-Z']?$/,target:'input'},
                        ".email":{rx:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@(( ?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1 [0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][ 0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i,target:'input'},
                        ".phone":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'},
                        ".fax":{rx:/^\+?(\d[\d\-\+\(\) ]{5,}\d$)/,target:'input'},
                        ".message":{rx:/.{20}/,target:'textarea'}
                    preFu:function(){
                        _.labels.each(function(){
                            var label=$(this),
                                inp=$(_.targets,this),
                                defVal=inp.val(),
                                trueVal=(function(){
                                            var tmp=inp.is('input')?(tmp=label.html().match(/value=['"](.+?)['"].+/),!!tmp&&!!tmp[1]&&tmp [1]):inp.html()
                                            return defVal==''?defVal:tmp
                            trueVal!=defVal
                                &&inp.val(defVal=trueVal||defVal)
                            label.data({defVal:defVal})                               
                            inp
                                .bind('focus',function(){
                                    inp.val()==defVal
                                        &&(inp.val(''),_.hideEmptyFu(label),label.removeClass(_.invalidCl))
                                .bind('blur',function(){
                                    _.validateFu(label)
                                    if(_.isEmpty(label))
                                        inp.val(defVal)
                                        ,_.hideErrorFu(label.removeClass(_.invalidCl))                                           
                                .bind('keyup',function(){
                                    label.hasClass(_.invalidCl)
                                        &&_.validateFu(label)
                            label.find('.'+_.errorCl+',.'+_.emptyCl).css({display:'block'}).hide()
                        _.success=$('.'+_.successCl,_.form).hide()
                    isRequired:function(el){                           
                        return !el.hasClass(_.notRequiredCl)
                    isValid:function(el){                           
                        var ret=true
                        $.each(_.rx,function(k,d){
                            if(el.is(k))
                                ret=d.rx.test(el.find(d.target).val())                                       
                        return ret                           
                    isEmpty:function(el){
                        var tmp
                        return (tmp=el.find(_.targets).val())==''||tmp==el.data('defVal')
                    validateFu:function(el){                           
                        el.each(function(){
                            var th=$(this)
                                ,req=_.isRequired(th)
                                ,empty=_.isEmpty(th)
                                ,valid=_.isValid(th)                               
                            if(empty&&req)
                                _.showEmptyFu(th.addClass(_.invalidCl))
                            else
                                _.hideEmptyFu(th.removeClass(_.invalidCl))
                            if(!empty)
                                if(valid)
                                    _.hideErrorFu(th.removeClass(_.invalidCl))
                                else
                                    _.showErrorFu(th.addClass(_.invalidCl))                               
                    getValFromLabel:function(label){
                        var val=$('input,textarea',label).val()
                            ,defVal=label.data('defVal')                               
                        return label.length?val==defVal?'nope':val:'nope'
                    ,submitFu:function(){
                        _.validateFu(_.labels)                           
                        if(!_.form.has('.'+_.invalidCl).length)
                            $.ajax({
                                type: "POST",
                                url:_.mailHandlerURL,
                                data:{
                                    name:_.getValFromLabel($('.name',_.form)),
                                    email:_.getValFromLabel($('.email',_.form)),
                                    phone:_.getValFromLabel($('.phone',_.form)),
                                    fax:_.getValFromLabel($('.fax',_.form)),
                                    state:_.getValFromLabel($('.state',_.form)),
                                    message:_.getValFromLabel($('.message',_.form)),
                                    owner_email:_.ownerEmail,
                                    stripHTML:_.stripHTML
                                success: function(){
                                    _.showFu()
                    showFu:function(){
                        _.success.slideDown(function(){
                            setTimeout(function(){
                                _.success.slideUp()
                                _.form.trigger('reset')
                            },_.successShow)
                    controlsFu:function(){
                        $(_.controls,_.form).each(function(){
                            var th=$(this)
                            th
                                .bind('click',function(){
                                    _.form.trigger(th.data('type'))
                                    return false
                    showErrorFu:function(label){
                        label.find('.'+_.errorCl).slideDown()
                    hideErrorFu:function(label){
                        label.find('.'+_.errorCl).slideUp()
                    showEmptyFu:function(label){
                        label.find('.'+_.emptyCl).slideDown()
                        _.hideErrorFu(label)
                    hideEmptyFu:function(label){
                        label.find('.'+_.emptyCl).slideUp()
                    init:function(){
                        _.form=_.me                       
                        _.labels=$('label',_.form)
                        _.preFu()
                        _.controlsFu()
                        _.form
                            .bind('submit',function(){
                                if(_.validate)
                                    _.submitFu()
                                else
                                    _.form[0].submit()
                                return false
                            .bind('reset',function(){
                                _.labels.removeClass(_.invalidCl)                                   
                                _.labels.each(function(){
                                    var th=$(this)
                                    _.hideErrorFu(th)
                                    _.hideEmptyFu(th)
                        _.form.trigger('reset')
            _.me||_.init(_.me=th.data({forms:_}))
            typeof o=='object'
                &&$.extend(_,o)
})(jQuery)
$(window).load(function() {   
    $('#ContactForm').forms({
        ownerEmail:'I Have Client's Email Here'
Contact HTML --
<form action="contact.php" method="post" id="ContactForm">
                            <div class="success"> Contact form submitted!<br>
                              <strong>We will be in touch soon.</strong> </div>
                            <fieldset>
                              <div class="wrapper">
                                <span class="col1">Name:</span>
                                <label class="name">
                                  <span class="bg"><input name="cf_name" type="text" class="input"></span>
                                  <span class="error">*This is not a valid name.</span> <span class="empty">*This field is required.</span>
                                  </label>
                                </div>
                              <div class="wrapper">
                                <span class="col1">Email:</span>
                                <label class="email">
                                  <span class="bg"><input name="cf_email" type="text" class="input"></span>
                                  <span class="error">*This is not a valid email address.</span> <span class="empty">*This field is required.</span>
                                  </label>
                                </div>
                              <div class="wrapper">
                                <span class="col1">Phone:</span>
                                <label class="phone">
                                  <span class="bg"><input name="cf_phone" type="text" class="input"></span>
                                  <span class="error">*This is not a valid phone number.</span> <span class="empty">*This field is required.</span>
                                  </label>
                                </div>
                              <div class="wrapper">
                                <span class="col1">Message:</span>
                                <label class="message">
                                  <span class="bg"><textarea name="cf_message" rows="1" cols="1"></textarea></span>
                                  <span class="error">*The message is too short.</span> <span class="empty">*This field is required.</span>
                                  </label>
                                </div>
                              <div class="btns"><a href="#" class="link1" data-type="submit">Send</a><a href="#" class="link1" data-type="reset">Clear</a></div>
                              </fieldset>
                            </form>

If Template Monster supplied you with this code, I think you should contact them about it.
It's not how I would do things.
Nancy O.

Similar Messages

  • Help with web form script. PHP, CGI, Perl???

    anyone willing to help with a web form script? I have a form built, but cant seem to figure out the scripting! Should I be using Perl, CGI, PHP... What do I need to enable? I am a complete novice when it comes to scripts. Looking for a little friendly help.

    Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
    <pre>
    <?php
    $emailFrom = '[email protected]';
    $emailTo = '[email protected]';
    $emailSubject = 'Subject';
    $date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
    $browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
    $hostname = $HTTPSERVER_VARS['REMOTEADDR'];
    $message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
    foreach ($_POST as $key => $value) {
    $message .= $key . ": " . $value . "\n";
    $mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
    ?>
    </pre>
    This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
    Also, this script expects your form method="post".
    Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
    <pre><?php
    if ($mailResult) {
    echo "Your comments have been received thank you.";
    } else {
    echo "There was an error. Please try again or contact us using an alternate method.";
    ?></pre>

  • Help with initializing/sending a contact form

    Hi guys.
    Basically, I created a standard HTML webpage(s) in Dreamweaver (this form is on a HTML file, not a PHP file). I have a form in there (at the footer of all my webpages), and it looks like this:
      <div id="form">
                <form action="PHP/contact-send.php" id="contactForm" name="Form1" method="post"  >
                    <fieldset>
                        <p>
                             <label for="name">Name</label>
                            <input id="name" type="text" value="Under construction" name="Name"/>
                        </p>
                        <p>
                            <label for="email">Email</label>
                            <input id="email" type="text" value="Under construction" name="Email"/>
                        </p>
                        <div class="cl"><!-- --></div>
                        <p>
                            <label for="message">Message</label>
                            <textarea id="message" cols="10" rows="10" name="message" ></textarea>
                        </p>
                        <p><input class="sumbit_button" type="submit" name="submit" value="" id="submit" /></p>
                    </fieldset>
                </form>
              </div>
    I have styled this form, and added Jquery validation to it which works fine.
    All I want to do isinitialize this form to send e-mail (I uploaded my website, and the form does not work)... I have specified the path to the PHP (PHP/contact-send.php) in the form (and yes, I put the PHP file in my website's directory... lol), and yet the form does not work. Very frustrating... Especially after I have tried a lot of different PHP codes, and none of them work.. Can someone please help me with a simple PHP code that I can paste into my "contact-send.php" file and link to the form in the "index.html" file? Also, if possible
    a popup message that shows when the form is successfully sent (not on a new page, just a simple Javascript alert).
    I am using 000webhost, and a free domain (.co.cc).
    Also, I would like to have a search bar on my website... that, too has been styled, I just want to know how I can code it to have it function and display results.
    Thankyou for your help guys.

    I suppose this means I can have the form working on a HTML file and simply link it to the file containing the PHP code in the "form action"?  
    In other words, I don't need to have my form design on a PHP file for it to work?
    Correct. 
    <form action="path/form-processing-script.php"
    Also, I'd rather not have the user be redirected to a new page when the form is sent. Can I simply use an alert popup message? (i.e. "your message has been sent, click OK to contine) 
    Most scripts provide variables for either redirecting to a success.html page or displaying error & success messages in the script.
    I don't favor client-side "alert boxes" because they won't display if JavaScript is disabled in browsers.
    Also like I said before, I have already styled the form, and added validation... Do any of those links allow for me to simply use the PHP code (editing the necessary fields like "name" and "email") without having to use their validation as well?
    Yes, you could use your current form providing all field names exactly match those in the script.
    As above, client-side validation only works if JavaScript is enabled in browsers.
    PHP (server-side) validation is much more reliable.
    Related links from an earlier discussion:
    PHP Code (note the variables):
    http://forums.adobe.com/message/3970070#3970070
    HTML Form: (note the form field names)
    http://forums.adobe.com/message/3970073#3970073
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Help With Registration Form

    Hi
    I have created a registration form, where on the first page
    the user enters a user name and password, then they go to the next
    page where they enter their name. This then goes to the next page
    where they enter their address, then there contact details.
    But I want all these details to go on to a page where they
    can review their details, then press a submit button which inserts
    the data into a mysql db.
    But I need help with how I do this?
    I have created the following Java script in the body. Or
    should it be in the header? Or on another form? to insert their
    details:-
    <% Insert Data %>
    <jrun:sql datasrc="regift">
    INSERT INTO account VALUES ('<%=
    request.getParameter("User_Name").trim() %>',
    '<%= request.getParameter("Password").trim() %>',
    INSERT INTO name VALUES ('<%=
    request.getParameter("First_Name").trim() %>',
    '<%= request.getParameter("Last_Name").trim() %>'
    INSERT INTO address VALUES ('<%=
    request.getParameter("House_Number").trim() %>',
    '<%= request.getParameter("Street").trim() %>',
    '<%= request.getParameter("Town").trim() %>',
    '<%= request.getParameter("County").trim() %>',
    '<%= request.getParameter("Postcode").trim() %>'
    INSERT INTO contact_details VALUES ('<%=
    request.getParameter("Email_Address").trim() %>',
    '<%= request.getParameter("Telephone_Number").trim()
    %>'
    </jrun:sql>
    Is this correct?
    Thanks for all your help, Lou.

    Your code is correct only for the first page. What you need
    to do after the
    initial record is entered is grab its ID and then on
    subsequent pages you
    would use and UPDATE sql statement
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "LoobieLouLou" <[email protected]> wrote in
    message
    news:emggvv$q67$[email protected]..
    > Hi
    >
    > I have created a registration form, where on the first
    page the user
    > enters a
    > user name and password, then they go to the next page
    where they enter
    > their
    > name. This then goes to the next page where they enter
    their address, then
    > there contact details.
    >
    > But I want all these details to go on to a page where
    they can review
    > their
    > details, then press a submit button which inserts the
    data into a mysql
    > db.
    >
    > But I need help with how I do this?
    >
    > I have created the following Java script in the body. Or
    should it be in
    > the
    > header? Or on another form? to insert their details:-
    >
    > <% Insert Data %>
    > <jrun:sql datasrc="regift">
    >
    > INSERT INTO account VALUES ('<%=
    request.getParameter("User_Name").trim()
    > %>',
    > '<%= request.getParameter("Password").trim() %>',
    >
    > INSERT INTO name VALUES ('<%=
    request.getParameter("First_Name").trim()
    > %>',
    > '<%= request.getParameter("Last_Name").trim() %>'
    >
    > INSERT INTO address VALUES ('<%=
    > request.getParameter("House_Number").trim()
    > %>',
    > '<%= request.getParameter("Street").trim() %>',
    > '<%= request.getParameter("Town").trim() %>',
    > '<%= request.getParameter("County").trim() %>',
    > '<%= request.getParameter("Postcode").trim() %>'
    >
    > INSERT INTO contact_details VALUES ('<%=
    > request.getParameter("Email_Address").trim() %>',
    > '<%= request.getParameter("Telephone_Number").trim()
    %>'
    > </jrun:sql>
    >
    > Is this correct?
    >
    > Thanks for all your help, Lou.
    >
    >

  • HELP WITH A FORM

    Ok here is the problem,
    I am trying to make a form in my existing fla document and
    the form will not function.
    I have created the form and used the exact same php script in
    a seperate flash movie and the form worked fine but I can not get
    it to work in my existing fla.
    I would reall appreciate any help with this issue.....
    I need my file
    (download my file at
    http://66.70.213.43/testsite/main3.fla
    to have a working email submission form.
    this file has no working form on it now and the existing form
    can be modified but I would like to keep the submit and the reset
    buttons as is if possable.
    I would like to use the php email style that is in the lesson
    on gotoandlearn.com ( the lesson is listed as sending mail with php
    but I am willing to accept other methods if needed.
    The Movie clip symbol of the actual form with the submit and
    reset button is call P5_s7
    The Movie clip symbol of the page which contains the form is
    called PAGE 5
    I will edit the php and the flash script after you send the
    file to me to reflect the email addresses that I want to use so for
    testing purposes you can use any email that you want.
    I would really appreciate it if someone with more flash
    experience could help me out and post a working copy of my file and
    the php script that the form links to so that I could re download
    then.
    Thank you in advance
    Please note that there may be some $$$ in it for you if you
    can help me.......

    Don't think you're going to find anyone here who will just be
    willing to do the work for you. You might want to check out the
    Flash and PHP Integration sample file that comes with Flash 8 for
    some pointers on how to get this started.
    If you have specific questions later, write back! Good luck!

  • Help with PDF form responses

    Hey there!
    I have two issues with online form data collection and am completely stumped. It's a real struggle to find useful documentation for Acrobat forms!
    #1 - I have created a form uploaded it to Acrobat.com, and have been able to collect test form data. In the local responses portfolio, I'm able to use the 'Update' button to bring the latest form data into the portfolio. But I would like to have a colleague be responsible for monitoring the form data and we're running into problems. He's able to open the portfolio and has full access, however the 'Update' button is greyed out so he is unable to bring in new form data. We've already updated his 'Acrobat.com' username/password in Acrobat preferences to match mine, but still no luck. Any help?
    #2 - Some computers are having issues with electronic submission. My best guess is that this is to do with Acrobat versions, as the issues all seem to come from computers where the form is completed using Acrobat Reader 8. The form was created with Pro 9, and form submission works for both Pro 9 and also Reader 9. Is there something I can do here? (And yes I know that it's a free upgrade to 9, but 8 is still in the official build for our organisation and I don't really have time to wait for them to complete an upgrade!)
    Thanks in advance for any help you can give.
    Jarrod

    Hello Paul,
    Thank you for your reply.
    I use Ipower for my hosting.  I see they use sendmail and the path on the server is - /usr/sbin/sendmail.  Would this work?
    The way I would like this to work would be:
    1) I e-mail the PDF form to the client
    2) Client opens and fills in the form
    3) They hit submit and the form information eventually gets e-mailed to my business e-mail
    I chose to use the HTTP method instead of e-mail because the PDF form says it can not be saved and if the client uses an internet beased e-mail like Yahoo it gets kind of messy.
    But, does the HTTP delivery method make it more difficult since this is not embedded in a website?
    Sorry, I did not realise this would be as involved as it is.  Your help would be greatly appreciated.

  • Livecycle design 8 Help with PDF forms

    I am new to Livecycle 8. I have created a simple PDF form in Livecycle 8 which was orignally an excel form. I set it up with a submit button to submit by email to a designated person. The form is housed on an internal web site for viewers with adobe reader to open and fill out and then submit by email. The goal is for the designated receiver to receive the the same PDF form with the information filled out by the previous viewer. I was successful with the form being emailed to the designated person as long as the peson submitting the form was using adobe professional. If the viewer only has adobe reader, the form would not submit to the designated receiver. Please help? 

    Reader does not allow a local save of the form and data by default. To be able to add the attachment o an email message a local save must occur. You can Reader Extend your form to allow for this. Open th eform in Acrobat Pro. Under the Advanced menu choose the "Extend Features in Adobe Reader". Follow the wizard and save the result PDF as a different name ....I like to put RE in the name so I know it is Reader Extended. Try the new file.
    paul

  • Help with Parameter Form

    Hello, I have a somewhat complicated Report and I am hoping that I can create the Parameter Form in Reports (I would rather not use Forms because I don't know it as well)
    Here's my problem:
    Right now I have 2 fields that I need help with.
    The first one is called "Report Name" and I have it coded to a bind variable that will search for a series of "work units" such as 02% or 03%
    This works as coded, the problem comes with the other "Work Unit" field. What I have right now is a LOV that queries for work units that start in either 02 or 03. This variable will narrow down the report findings to the specific work unit selected. What I want is for this list to be dependant on what the user choses for report name.
    For example if the user choses ReportName1 the report query finds work units with 02%, but the "work unit" field still displays the list of work units 02% and 03% and the user must know to only chose the certain work units for the specific "Report Name" selected.
    If there is a way to somehow have the "Work Unit" field be dependant on the "Report Name" field please give me soem ideas of how to do it.

    Thats what I was worried about.
    Well I have been trying to learn forms for some time now but I can't quite get the hang of it yet.
    I don't really have anyone who knows it here, so I'm kind of learning on my own.
    Thanks for the response.
    Arin

  • Help with Login Form (JSP DB Java Beans Session Tracking)

    Hi, I need some help with my login form.
    The design of my authetication system is as follows.
    1. Login.jsp sends login details to validation.jsp.
    2. Validation.jsp queries a DB against the parameters received.
    3. If the query result is good, I retrieve some information (login id, name, etc.) from the DB and store it into a Java Bean.
    4. The bean itself is referenced with the current session.
    5. Once all that's done, validation.jsp forwards to main.jsp.
    6. As a means to maintain state, I prefer to use url encoding instead of cookies for obvious reasons.I need some help from step 3 onwards please! Some code snippets will do as well!
    If you think this approach is not a good practice, pls let me know and advice on better practices!
    Thanks a lot!

    Alright,here is an example for you.
    Assume a case where you don't want to give access to any JSP View/HTML Page/Servlet/Backing Bean unless user logging system and let assume you are creating a View Object with the name.
    checkout an example (Assuming the filter is being applied to a pattern * which means when a resource is been accessed by webapplication using APP_URL the filter would be called)
    public doFilter(ServletRequest req,ServletResponse res,FilterChain chain){
         if(req instanceof HttpServletRequest){
                HttpServletRequest request = (HttpServletRequest) req;
                HttpSession session = request.getSession();
                String username = request.getParameter("username");
                String password = request.getParameter("password");
                String method = request.getMethod();
                String auth_type  = request.getAuthType();
                if(session.getAttribute("useInfoBean") != null)
                    request.getRequestDispatcher("/dashBoard").forward(req,res);
                else{
                        if(username != null && password != null && method.equaIsgnoreCase("POST") && (auth_type.equalsIgnoreCase("FORM_AUTH") ||  auth_type.equalsIgnoreCase("CLIENT_CERT_AUTH")) )
                             chain.doFilter(req,res);
                        else 
                          request.getRequestDispatcher("/Login.jsp").forward(req,res);
    }If carefully look at the code the autherization is given only if either user is already logged in or making an attempt to login in secured way.
    to know more insights about where these can used and how these can be used and how ?? the below links might help you.
    http://javaboutique.internet.com/tutorials/Servlet_Filters/
    http://e-docs.bea.com/wls/docs92/dvspisec/servlet.html
    http://livedocs.adobe.com/jrun/4/Programmers_Guide/filters3.htm
    http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
    http://www.servlets.com/soapbox/filters.html
    http://www.onjava.com/pub/a/onjava/2001/05/10/servlet_filters.html
    and coming back to DAO Pattern hope the below link might help you.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
    http://java.sun.com/blueprints/patterns/DAO.html
    http://www.javapractices.com/Topic66.cjp
    http://www.ibm.com/developerworks/java/library/j-dao/
    http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-dao.html
    On the whole(:D) it is always a good practice to get back to Core Java/J2EE Patterns.and know answers to the question Why are they used & How do i implement them and where do i use it ??
    http://www.fluffycat.com/java-design-patterns/
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html
    http://www.cmcrossroads.com/bradapp/javapats.html
    Hope that might help :)
    REGARDS,
    RaHuL

  • Help with xfa-form

    Hello,
    I am a developer (VB6 ASP),
    Please, I need to know, What I need to populate/read an xfa-form, that was created for another company.
    I do not know what is the tool that I need to investigate, or a component. (the pdf form it was created with liveCycle)
    The original empty pdf form is in xfa-form and I need fill in and the resulted file is delivered to another person that stamp digital signature,
    I can fill this pdf form manually with adobe reader 9, but i need this task programmatically.
    has any idea for this?
    Thank you in advance!
    (sorry for my english)
    Clarisa

    Thank you Hodmi!
    Another question, I new in adobe Technologies, and I am lost in the family of LiveCycle products,
    I need pre-populate the pdf that I have attached, xfa-form1.pdf
    for example,
    1- I download this pdf from an external site,
    2- I have to pre-populate with 2 Fields that I obtain from my Database,
    3- I embed this pdf file in aspx page(ASP.NET)
    4- the user 1 must put their signature.
    4- the user 2 must put their signature.
    End
    I saw code that manipulate programmatically .xdp files with pdf forms, but I do not know if I can manipulate this pdf that I have attached, please, could you help me, If in theory I Can do that?
    (I have to do with ASP.NET)
    Best Regards!
    Clarisa

  • Help with Scripting forms when additional characters added

    Hi,
    I am new to scripting in adobe professional, I thank anyone in advance for any advice or help they can give me.
    I am trying to use the calcuations within the forms that I am putting fields onto.  In the process I discovered that the program the forms are within are attaching a pipe and additional characters after the actual name that I have named them.  So, I am not able to use even the simple calculations within adobe to "sum" fields.   For example: I named the field "1_1Text" and this is what displays when you go into the calculations and pick the fields you want.  But the actual name is "1_1Text|1234567" so the calculations will not work.
    I take it then I need to use the advanced scripting but I am unsure of the format for a routine such as this.  I have a little knowledge of javascript but it has been awhile.  There must be a scan to find the pipe and then you should be able to chop off the extra characters since I will never know the characters the program adds on so then I can do calculations on these fields. Then you would have to put them into an array or something to save them?   Any help with a script or hints would surely be appreciated.
    Thanks!

    Could explain more fully how you are creating your forms and what programs you are using from the creation of the base document to which program and how you are adding fields.
    I think you are misunderstanding me.   I use Adobe Acrobat Professional 6.0.  I can get the calculations to work correctly if I use the form as it is after creating it. 
    But these forms are put into an SQL database and they get selected within a VB.net program or ASP.net program (both are used).  So these programs (VB.net or ASP.net) are adding the extra characters at the end, hence I do not know the names of the fields when the forms are being filled in.  So the calculations do not work with the "original names" that I created for the fields.
    I just figured if I created a routine that looped through and chopped off the extra characters these programs put on the end I would be able to do the calcuations and they would work.  I believe there is a substring operation within javascript.

  • Help with Custom Forms Report

    Hi there,
    I recently created a new custom web form in BC that appears to be working fine.
    My problem is that when I go to custom reports, in filter criteria I can't see my new form under the 'Custom CRM Form Filter'. All my other forms are appearing here however.
    Am I just missing one small step?
    Thanks for the help!

    Yor form must not have any custom fields, which is why it isn't in that
    dropdown. You can use the case subject to filter the cases where the case
    subject is the webform name.
    Cheers,
    Mario
    www.twoblokeswithapostie.com

  • Need Urgent Help with Apache and PHP

    I have been struggling with apache and php for a week now and I finally broke down to post a message.
    I have apache 1.3 running on my mac mini g4 with 10.4.9 and I installed sql. I went to the entropy website and downloaded php5 to install without knowing I already had php4 on the machine. I installed 5 but could not get it to work. I then went back to httpd.conf and tried to install php4 by uncommenting out the loadmodule and addmodule lines. I restarted apache but php still did not work. I tested the phpinfo.php script but all I got was the script in Safari and not the actual page. At the moment, I have php4 and php5 on my machine but can't get either one to work. I am sure there is an easy fix but I don't know it. Please help.

    The problem is not terribly complicated, but Apache will not start with the entropy file in the folder
    /etc/httpd/users/
    Let me experiment on you. Rename the entropy file and then try to start Apache. To do this, open Terminal and paste this command:
    <pre>sudo mv /etc/httpd/users/+entropy.conf /etc/httpd/users/+entropy<pre>
    Now check the Apache configuration:
    <pre>apachectl configtest<pre>
    If it says "Syntax OK", start Apache:
    <pre>sudo apachectl start<pre>
    Since we only disabled the entropy file, you should be able to enable PHP5 with some more advanced configuring.

  • Help with iCloud - calendars and contacts!!!!

    I just got icloud with osx lion and i am completely lost. I have iphone and just got ios5. Before when i synced to itunes, i could choose certain calendars and contact groups to sync (shared computer) anyone know how to do the same on icloud.
    any help with ical on osx lion? I want the same calendar on my mac so I can publish but also share it on icloud. HELP!!!!!!!!!!

    Hello easbda,
    Thank you for providing the details of the calendar issue you are experiencing with your iPhone.  I recommend following the steps in the section titled "Troubleshooting on Microsoft Windows (Microsoft Outlook)" in the following article to assist with syncing your calendar events between your devices:
    iCloud: Troubleshooting iCloud Calendar
    http://support.apple.com/kb/ts3999
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Need Help with Conatct Form

    I created a Contact Form  in DW CS6, and I used the php and html files provided by Nancy O. in her forum dated back to October 2011. Follow the link for details. http://forums.adobe.com/message/3970070#3970070
    I believe I have followed all the required steps, and almost everything seems working properly, except that I am not (Recipient) getting an e-mail. However, the client has received an automated reply from me (Recipient). But no e-mail were sent to me.
    Please refer to below (Part of php code - Between Lines 12 and 35) where I have made the changes:
    I am not sure where I have made an error(s). Could anyone please assist?

    Hi Nancy,
    I created a new Gmail address as you suggested, and then tested the Form with it. I still can't receive an e-mail.
    Also, I have contacted my Web Host, and they confirmed that there are no issues from their end.
    I have attached below both the php and the html files, and I would appreciate if you can take a look at them for correctness:
    PHP File:
    <?php
    // Form Processing Script
    // General Variables
        $check_referrer="no";
        $referring_domains="http://domain.com/,http://www.domain.com/,http://subdomain.domain.com/";
    // options to use if hidden field "config" has a value of 0
    // recipient info
        $charset[0]="iso-8859-1";
        $tomail[0]="[email protected]";
        $cc_tomail[0]=" ";
        $bcc_tomail[0]="";
    // Mail contents config
        $subject[0]="message from EMCG.COM";
        $reply_to_field[0]="email";
        $reply_to_name[0]="email";
        $required_fields[0]="first_name,last_name";
        $required_email_fields[0]="email";
        $attachment_fields[0]="";
        $return_ip[0]="yes";
        $mail_intro[0]="The following message was sent from EMCG.COM:";
        $mail_fields[0]="first_name,last_name,email,phone,subject,message";
        $mail_type[0]="text";
        $mail_priority[0]="1";
        $allow_html[0]="no";
    // Send back to sender config
        $send_copy[0]="yes";
        $copy_format[0]="vert_table";
        $copy_fields[0]="first_name,last_name,subject,message";
        $copy_attachment_fields[0]="";
        $copy_subject[0]="EMCG automated reply";
        $copy_intro[0]="Thanks for taking time to contact EMCG. Someone will be in touch with you soon.";
        $copy_from[0]="[email protected]";
        $copy_tomail_field[0]="email";
    // Result options
        $header[0]="";
        $footer[0]="";
        $error_page[0]="";
        $thanks_page[0]="";
    // Default Error and Success Page Variables
        $error_page_title[0]="Error - Missing Fields";
        $error_page_text[0]="Required information is missing. Please use your browser's back button to return to the form and complete the required fields.";
        $thanks_page_title[0]="Success - Form processing completed";
        $thanks_page_text[0]="Thank you. Please check your e-mail for an automated confirmation. ";
    // Antispam Options
        $empty_field[0]="nospam";
        $character_scan[0]="message";
        $time_delay[0]="";
        $captcha_codes[0]="9C2449,EEADC8,77A585,D72838";
        $max_urls[0]="1";
        $max_url_fields[0]="message";
        $flag_spam[0]="";
    // Don't muck around past this line unless you know what you are doing //
    ob_start();
    $config=$_POST["config"];
    $debug=0;
    $debug_text="";
    // fix for Windows email server security
    ini_set("sendmail_from",$tomail[$config]);
    // email validation regular expression
    $regex = "^[-a-z0-9!#$%&\'*+/=?^_`{|}~]+(\.[-a-z0-9!#$%&\'*+/=?^_`{|}~]+)*@(([a-z0-9]([-a-z0-9]*[a -z0-9]+)?){1,63}\.)+([a-z]([-a-z0-9]*[a-z0-9]+)?){2,63}$";
    $header_injection_regex = "(\r|\n)";
    if($header[$config]!="")
        include($header[$config]);
    if($_POST["submit"] || $_POST["Submit"] || $_POST["submit_x"] || $_POST["Submit_x"])
    // begin global functions //
    // get visitor IP
        function getIP()
            if(getenv(HTTP_X_FORWARDED_FOR))
                $user_ip=getenv("HTTP_X_FORWARDED_FOR");
            else
                $user_ip=getenv("REMOTE_ADDR");
            return $user_ip;
    // get value of given key
        function parseArray($key)
            $array_value=$_POST[$key];
            $count=1;
            extract($array_value);
            foreach($array_value as $part_value)
                if($count > 1){$value.=", ";}
                $value.=$part_value;
                $count=$count+1;
            return $value;
    // stripslashes and autolink url's
        function parseValue($value)
            $value=preg_replace("/(http:\/\/+.[^\s]+)/i",'<a href="\\1">\\1</a>', $value);
            return $value;
    // html header if used
        function htmlHeader()
            $htmlHeader="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n<html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$charset[$config]."\"></head>\n<body>\n<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"600\">\n";
            return $htmlHeader;
    // html footer if used
        function htmlFooter()
            $htmlFooter="</table>\n</body>\n</html>\n";
            return $htmlFooter;
    // build verticle table format
        function buildVertTable($fields, $intro, $to, $send_ip)
            $message=htmlHeader();
            if($intro != "")
                $message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"2\">".$intro."</td>\n</tr>\n";
            $fields_check=preg_split('/,/',$fields);
            $run=sizeof($fields_check);
            for($i=0;$i<$run;$i++)
                $cur_key=$fields_check[$i];
                $cur_value=$_POST[$cur_key];
                if(is_array($cur_value))
                    $cur_value=parseArray($cur_key);
                $cur_value=parseValue($cur_value);
                if($allow_html[$config]=="no")
                    $cur_value=htmlspecialchars(nl2br($cur_value));
                else
                    $cur_value=nl2br($cur_value);
                $message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$cur_value."</td>\n</tr>\n";
            if($send_ip=="yes" && $to=="recipient")
                $user_ip=getIP();
                $message.="<tr>\n<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n<td align=\"left\" valign=\"top\" width=\"100%\">".$user_ip."</td>\n</tr>\n";
            $message.=htmlFooter();
            return $message;
    // build horizontal table format
        function buildHorzTable($fields, $intro, $to, $send_ip)
            $message=htmlHeader();
            $fields_check=preg_split('/,/',$fields);
            $run=sizeof($fields_check);
            if($intro != "")
                $message.="<tr>\n<td align=\"left\" valign=\"top\" colspan=\"".$run."\">".$intro."</td>\n</tr>\n";
            $message.="<tr>\n";
            for($i=0;$i<$run;$i++)
                $cur_key=$fields_check[$i];
                $message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>".$cur_key."</b></td>\n";
            if($send_ip=="yes" && $to=="recipient")
                $message.="<td align=\"left\" valign=\"top\" style=\"white-space:nowrap;\"><b>Sender IP</b></td>\n";
            $message.="</tr>\n";
            $message.="<tr>\n";
            for($i=0;$i<$run;$i++)
                $cur_key=$fields_check[$i];
                $cur_value=$_POST[$cur_key];
                if(is_array($cur_value))
                    $cur_value=parseArray($cur_key);
                $cur_value=parseValue($cur_value);
                if($allow_html[$config]=="no")
                    $cur_value=htmlspecialchars(nl2br($cur_value));
                else
                    $cur_value=nl2br($cur_value);
                $message.="<td align=\"left\" valign=\"top\">".$cur_value."</td>\n";
            $message.="</tr>\n";
            $message.="<tr>\n";
            if($send_ip=="yes" && $to=="recipient")
                $user_ip=getIP();
                $message.="<td align=\"left\" valign=\"top\">".$user_ip."</td>\n";
            $message.="</tr>\n";
            $message.=htmlFooter();
            return $message;
    // build plain text format
        function buildTextTable($fields, $intro, $to, $send_ip)
            $message="";
            if($intro != "")
                $message.=$intro."\n\n";
            $fields_check=preg_split('/,/',$fields);
            $run=sizeof($fields_check);
            for($i=0;$i<$run;$i++)
                $cur_key=$fields_check[$i];
                $cur_value=$_POST[$cur_key];
                if(is_array($cur_value))
                    $cur_value=parseArray($cur_key);
                $cur_value=parseValue($cur_value);
                if($allow_html[$config]=="no")
                    $cur_value=htmlspecialchars($cur_value);
                else
                    $cur_value=$cur_value;
                $message.="".$cur_key.": ".$cur_value."\n";
            if($send_ip=="yes" && $to=="recipient")
                $user_ip=getIP();
                $message.="Sender IP: ".$user_ip."\n";
            return $message;
    // get the proper build fonction
        function buildTable($format, $fields, $intro, $to, $send_ip)
            if($format=="vert_table")
                $message=buildVertTable($fields, $intro, $to, $send_ip);
            else if($format=="horz_table")
                $message=buildHorzTable($fields, $intro, $to, $send_ip);
            else
                $message=buildTextTable($fields, $intro, $to, $send_ip);
            return $message;
    // referrer checking security option
        function checkReferer()
            if($check_referrer=="yes")
                $ref_check=preg_split('/,/',$referring_domains);
                $ref_run=sizeof($ref_check);
                $referer=$_SERVER['HTTP_REFERER'];
                $domain_chk="no";
                for($i=0;$i<$ref_run;$i++)
                    $cur_domain=$ref_check[$i];
                    if(stristr($referer,$cur_domain)){$domain_chk="yes";}
            else
                $domain_chk="yes";
            return $domain_chk;
    // checking required fields and email fields
        function checkFields($text_fields, $email_fields, $regex)
              $error_message="";
            if($debug==1)
                $error_message.="<li>text_fields: ".$text_fields."<br />email_fields: ".$email_fields."<br />reply_to_field: ".$reply_to_field."<br />reply_to_name: ".reply_to_name."</li>";
            if($text_fields != "")
                $req_check=preg_split('/,/',$text_fields);
                $req_run=sizeof($req_check);
                for($i=0;$i<$req_run;$i++)
                    $cur_field_name=$req_check[$i];
                    $cur_field=$_POST[$cur_field_name];
                    if($cur_field=="")
                        $error_message.="<li>You are missing the <b>".$req_check[$i]."</b> field</li>\n";
            if($email_fields != "")
                $email_check=preg_split('/,/',$email_fields);
                $email_run=sizeof($email_check);
                for($i=0;$i<$email_run;$i++)
                    $cur_email_name=$email_check[$i];
                    $cur_email=$_POST[$cur_email_name];
                    if($cur_email=="" || !eregi($regex, $cur_email))
                        $error_message.="<li>You are missing the <b>".$email_check[$i]."</b> field or it is not a valid email address.</li>\n";
            return $error_message;
    // attachment function
        function getAttachments($attachment_fields, $message, $content_type, $border)
            $att_message="This is a multi-part message in MIME format.\r\n";
            $att_message.="--{$border}\r\n";
            $att_message.=$content_type."\r\n";
            $att_message.="Content-Transfer-Encoding: 7bit\r\n\r\n";
            $att_message.=$message."\r\n\r\n";
            $att_check=preg_split('/,/',$attachment_fields);
            $att_run=sizeof($att_check);
            for($i=0;$i<$att_run;$i++)
                $fileatt=$_FILES[$att_check[$i]]['tmp_name'];
                $fileatt_name=$_FILES[$att_check[$i]]['name'];
                $fileatt_type=$_FILES[$att_check[$i]]['type'];
                if (is_uploaded_file($fileatt))
                    $file=fopen($fileatt,'rb');
                    $data=fread($file,filesize($fileatt));
                    fclose($file);
                    $data=chunk_split(base64_encode($data));
                    $att_message.="--{$border}\n";
                    $att_message.="Content-Type: {$fileatt_type}; name=\"{$fileatt_name}\"\r\n";
                    $att_message.="Content-Disposition: attachment; filename=\"{$fileatt_name}\"\r\n";
                    $att_message.="Content-Transfer-Encoding: base64\r\n\r\n".$data."\r\n\r\n";
            $att_message.="--{$border}--\n";
            return $att_message;
    // function to set content type
        function contentType($charset, $format)
            if($format=="vert_table")
                $content_type="Content-type: text/html; charset=".$charset."\r\n";
            else if($format=="horz_table")
                $content_type="Content-type: text/html; charset=".$charset."\r\n";
            else
                $content_type="Content-type: text/plain; charset=".$charset."\r\n";
            return $content_type;
    // end global functions //
    // begin procedural scripting //
        // anti-spam empty field check
        if($_POST[$empty_field[$config]] != "")
            $empty_message = "<li>This submission failed and was flagged as spam.</li>\n";
        // anti-spam character scan check
        if(strlen($character_scan[$config]) > 0)
            $spam_message="";
            $field_check=preg_split('/,/',$character_scan[$config]);
            $field_run=sizeof($field_check);
            for($i=0;$i<$field_run;$i++)
                $cur_field_name=$field_check[$i];
                $cur_field=$_POST[$cur_field_name];
                if(preg_match("/<(.|\n)+?>/", $cur_field) || preg_match("/\[(.|\n)+?\]/", $cur_field))
                    $spam_message.="<li>This message contains disallowed characters.</li>\n";
        // anti-spam time delay check
        if((strlen($time_delay[$config]) > 0 && strlen($_POST["time"]) > 0) || (strlen($time_delay[$config]) > 0 && (strlen($_POST["time"]) == 0 || !$_POST["time"])))
            if((time() - $_POST["time"]) < $time_delay[$config])
                $time_message = "<li>This has been stopped by the timer, and is likely spam.</li>\n";
        // anti-spam CAPTCHA check
        if(strlen($captcha_codes[$config]) > 0)
            $captcha_check=preg_split('/,/',$captcha_codes[$config]);
            if(strtolower($_POST["captcha_entry"]) != strtolower($captcha_check[$_POST["captcha_code"]]))
                $captcha_message = "<li>CAPTCHA test did not match.</li>\n";
        // anti-spam max URL check
        if(strlen($max_url_fields[$config]) > 0)
            $max_url_message="";
            $field_check=preg_split('/,/',$max_url_fields[$config]);
            $field_run=sizeof($field_check);
            for($i=0;$i<$field_run;$i++)
                $cur_field_name=$field_check[$i];
                $cur_field=$_POST[$cur_field_name];
                preg_match_all("/http:/", $cur_field, $matches);
                if(count($matches[0]) > $max_urls[$config])
                    $max_url_message.="<li>This message contains too many URL's.</li>\n";
        // set anti-spam flagging option
        if(strlen($empty_message.$spam_message.$time_message.$captcha_message.$max_url_message) > 0 && strlen($flag_spam[$config]) == 0)
            $set_flag = 2;
        else if(strlen($empty_message.$spam_message.$time_message.$captcha_message.$max_url_message) > 0 && strlen($flag_spam[$config]) > 0)
            $set_flag = 1;
        else
            $set_flag = 0;
        // header injection check
           $security_filter="";
        if(strlen($_POST[$reply_to_field[$config]]) > 0)
            if(eregi($header_injection_regex,$_POST[$reply_to_field[$config]]))
                $security_filter.="<li>Header injection attempt detected, mail aborted.</li>\n";
            else
                $reply_to_field_checked=$_POST[$reply_to_field[$config]];
        if(strlen($_POST[$reply_to_name[$config]]) > 0)
            if(eregi($header_injection_regex,$_POST[$reply_to_name[$config]]))
                $security_filter.="<li>Header injection attempt detected, mail aborted.</li>\n";
            else
                $reply_to_name_checked=$_POST[$reply_to_name[$config]];
        // check domain referrer and continue
        $domain_chk=checkReferer();
        if($domain_chk=="yes")
            $error_message=checkFields($required_fields[$config], $required_email_fields[$config], $regex);
            if(strlen($error_message) < 1 && strlen($security_filter) < 1 && $set_flag < 2)
                // build appropriate message format for recipient
                $content_type=contentType($charset[$config], $mail_type[$config]);
                $message=buildTable($mail_type[$config], $mail_fields[$config], $mail_intro[$config], "recipient", $return_ip[$config]);
                // build header data for recipient message
                //$extra="From: ".$_POST[$reply_to_field[$config]]."\r\n";
                $extra="From: ".$reply_to_name_checked." <".$reply_to_field_checked.">\r\n";
                if($cc_tomail[$config]!="")
                    $extra.="Cc: ".$cc_tomail[$config]."\r\n";
                if($bcc_tomail[$config]!="")
                    $extra.="Bcc: ".$bcc_tomail[$config]."\r\n";
                if($mail_priority[$config]!="")
                    $extra.="X-Priority: ".$mail_priority[$config]."\r\n";
                // get attachments if necessary
                if($attachment_fields[$config]!="")
                    $semi_rand=md5(time());
                    $border="==Multipart_Boundary_x{$semi_rand}x";
                    $extra.="MIME-Version: 1.0\r\n";
                    $extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";
                    $message=getAttachments($attachment_fields[$config], $message, $content_type, $border);
                else
                    $extra.="MIME-Version: 1.0\r\n".$content_type;
                // send recipient email
                if($debug==1)
                    if($set_flag == 1)
                        $debug_text.="<p><b>Mail would have sent flagged for spam if not in debug mode.</b></p>";
                    else
                        $debug_text.="<p><b>Mail would have sent if not in debug mode.</b></p>";
                else if($debug==0)
                    if($set_flag == 1)
                        $subject = $flag_spam[$config]." ".$subject[$config];
                    else
                        $subject = $subject[$config];
                    mail("".$tomail[$config]."", "".stripslashes($subject)."", "".stripslashes($message)."", "".$extra."");
                // autoresponse email if necessary
                if($send_copy[$config]=="yes")
                    // build appropriate message format for autoresponse
                    $content_type=contentType($charset[$config], $copy_format[$config]);
                    $message=buildTable($copy_format[$config], $copy_fields[$config], $copy_intro[$config], "autoresponder", $return_ip[$config]);
                    // build header data for autoresponse
                    $copy_tomail=$_POST[$copy_tomail_field[$config]];
                    $copy_extra="From: ".$copy_from[$config]."\r\n";
                    // get autoresponse  attachments if necessary
                    if($copy_attachment_fields[$config]!="")
                        $semi_rand=md5(time());
                        $border="==Multipart_Boundary_x{$semi_rand}x";
                        $copy_extra.="MIME-Version: 1.0\r\n";
                        $copy_extra.="Content-Type: multipart/mixed; boundary=\"{$border}\"";
                        $message=getAttachments($copy_attachment_fields[$config], $message, $content_type, $border);
                    else
                        $copy_extra.="MIME-Version: 1.0\r\n".$content_type;
                    // send autoresponse email
                    if($debug==1)
                        if($set_flag == 1)
                            $debug_text.="<p><b>Autoresponder would have sent flagged for spam if not in debug mode.</b></p>";
                        else
                            $debug_text.="<p><b>Autoresponder would have sent if not in debug mode.</b></p>";
                    else if($debug==0)
                        $send_copy = 1;
                        if($copy_tomail=="" || !eregi($regex,$copy_tomail))
                            $send_copy = 0;
                        if($send_copy == 1)
                            if($set_flag == 1)
                                $copy_subject = $flag_spam[$config]." ".$copy_subject[$config];
                            else
                                $copy_subject = $copy_subject[$config];
                            mail("$copy_tomail", "".$copy_subject."", "$message", "$copy_extra");
                // showing thanks pages from a successful submission
                if($thanks_page[$config]=="")
                    echo "<h3>".$thanks_page_title[$config]."</h3>\n";
                    echo "<p>".$thanks_page_text[$config]."</p>\n";
                    if(strlen($debug_text) > 0)
                        echo "<p><b><i>".$debug_text."</i></b></p>\n";
                else
                    header("Location: ".$thanks_page[$config]);
            else
                // entering error page options from missing required fields
                if($error_page[$config]=="")
                    echo "<h3>".$error_page_title[$config]."</h3>\n";
                    echo "<ul>\n";
                    echo $security_filter.$empty_message.$error_message.$spam_message.$time_message.$captcha_messa ge.$max_url_message;
                    echo "</ul>\n";
                    echo "<p>".$error_page_text[$config]."</p>\n";
                else
                    header("Location: ".$error_page[$config]);
        else
            echo "<h3>".$error_page_title[$config]."</h3>\n";
            // message if unauthorized domain trigger from referer checking option
            echo "<p>Sorry, mailing request came from an unauthorized domain.</p>\n";
    // end procedural scripting //
    else
        echo "<h3>Error</h3>";
        echo "<p>No form data has been sent to the script</p>\n";
    if($footer[$config]!="")
        include($footer[$config]);
    ob_end_flush();
    ?>
    <input type="button" value="Return to Form" onClick="javascript: history.go(-1);" />
    HTML File:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Sample Form</title>
    <style type="text/css">
    /**BEGIN FORM STYLES**/
    #form1 {
    font-size: 14px;
    width: 500px;
    margin: 0 auto; /**centered**/
    background: #FFF;
    border: 2px groove green;
    padding: 7px 14px 7px 14px;
    fieldset {
    margin-bottom: 5px;
    border-right: none;
    border-bottom: none;
    border-left: none;
    legend {
    padding: 8px;
    border: 1px solid silver;
    background: #009900;
    font-weight: bold;
    color: #FFFFFF;
    margin-left: -75px;
    *margin-left:0;
    line-height: 1.5
    /**wrap form lables and fields inside ordered lists for better web accessibility**/
    #form1 ol {
    list-style: none;
    margin: 0;
    padding: 0
    #form1 li {
    padding: 5px;
    margin: 0;
    clear: left;
    label {
    display: inline-block;
    float: left;
    line-height: 23px; /**lines up labels with fields**/
    width: 167px;
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-right: 10px; /*space between labels, fields*/
    input[type=text], textarea {
    width: 190px; /**same width on text fields**/
    padding: 5px;
    color: #666;
    border: 1px dotted #009900;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    /**field background on focus**/
    input:focus, input:active, textarea:focus, textarea:active {
    background-color: #EBECDE;
    border: 1px solid;
    #submit {
    margin-left: 45px;
    background: #009900;
    font-size: 18px;
    color: #FFF;
    font-weight: bold;
    border: 2px outset #FFF
    #submit:hover, #submit:focus, #submit:active {
    background: #006600;
    color: yellow;
    border: 2px inset #FFF
    /**END FORM STYLES**/
    </style>
    </head>
    <body>
    <!--BEGIN HTML FORM, action="path to form-processing script on your server" -->
    <form id="form1" action="vsi2.php" method="post" enctype="multipart/form-data" name="form1">
      <h3>HTML Contact Form</h3>
      <fieldset>
        <legend>Required Fields:</legend>
        <!--spam prevention-->
        <input name="config" type="hidden" value="0" />
        <input type="text" name="nospam" style="display:none" />
        <ol>
          <li>
            <label for="first_name">First Name:</label>
            <input name="first_name" id="first_name" type="text" />
          </li>
          <li>
            <label for="last_name">Last Name:</label>
            <input name="last_name" id="last_name" type="text" />
          </li>
          <li>
            <label for="email">E-mail:</label>
            <input name="email" id="email" type="text" />
          </li>
        </ol>
      </fieldset>
      <fieldset>
        <legend>Optional Fields:</legend>
        <ol>
          <li>
            <label for="phone">Phone number:</label>
            <input name="phone" id="phone" type="text" />
          </li>
          <li>
            <label for="subject">Subject:</label>
            <input name="subject" id="subject" type="text" />
          </li>
          <li>
            <label for="message">Message:</label>
            <textarea id="message" name="message"></textarea>
          </li>
          <li>
            <label for="submit"> </label>
            <input type="submit" name="submit" id="submit" value="Submit" />
          </li>
        </ol>
      </fieldset>
    </form>
    <!--END OF FORM -->
    </body>
    </html>
    Test File:
    http://www.energymcg.com/Original/contactus.html
    Thank you for your patience and for sticking with me. I really appreciate it.
    Khalid

Maybe you are looking for