Help with HTML form code

I need help on some HTML code if at all possible.
What I am trying to do is set up a page that someone can
enter their name address and email into a form and when they hit
the submit button it automatically sends them a premade email of my
choosing that I make prior and somehow maybe embeded into the html
code to the address that they entered? I dont know if it is
possible but I am sure it can be.
Thank you in advance

Actually, you could be subject to "abuse complaints", not
"abuse".
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"bregent" <[email protected]> wrote in
message
news:fb547q$b49$[email protected]..
> >What I am trying to do is set up a page that someone
can enter their name
> address
>
> Sure, you can do it fairly easily with any scripting
language. You need to
> be
> cautious about sending automated emails to anyone
without first validating
> that
> they are the actual owners of the email address,
otherwise you open your
> site
> up to abuse.
>
> >I dont know if it is possible but I am sure it can
be.
>
> Huh?
>

Similar Messages

  • Help with HTML form,please!

    Hi everybody,
    I'm trying to write an HTML form that would allow user to login if he/she has already created username and password AND that would let him/her create an account in case the user is not registered yet. The code below creates a form that allows the user login after what this provided data would be sent to some servlet:
    <HTML>
    <HEAD>
    <TITLE>Meeting-scheduling</TITLE>
    </HEAD>
    <BODY>
    <H2>Login To Meeting-Scheduling Program</H2>
    <FORM METHOD="POST" ACTION="someServlet">
    Username: <INPUT TYPE="TEXT" NAME="username" SIZE="25"><BR>
    Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE="25"><P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET" VALUE="Clear">
    </FORM>
    </BODY>
    </HTML>
    Now,I can't figure out how to add another button, for example, that would trigger another servlet and/or open another form and that would allow user to create an acount. Is this feasible at all? What I basically need is two forms on a single page triggering two different servlets. Thanks a lot,Jimmy.

    Yes u can trigger as many as servlets u want ,by using Javascript.make a normal button to act as submit button
    for e.g
    document.frm.action="/servlet/servletname"
    dovument.frm.method=post
    document.frm.submit()
    I hope this helps u :),if u still have problem mail me at
    [email protected]

  • 2 Formatting issues with HTML forms

    I have a couple of issues that we can't seem to get past with adobe livecycle designer 7.0. We have an internal form, rendered in HTML, that is emailed between departments, and the data entered is stored in an XML file that is created using the code similar to the following:
    protected void doPost(HttpServletRequest request,
    HttpServletResponse response) throws
    ServletException, IOException
    oOutput = response.getOutputStream();
    try {
    FormServerWithXML fsb = new FormServerWithXML();
    fsb.processForm(request);
    File file = File.createTempFile("Form_", ".tmp", new
    File("d:\\xmlFiles"));
    BufferedWriter(new FileWriter(file));
    out.write(fsb.getXMLString());
    out.close();
    When we use a numeric field and try to format it with any display pattern containing dollar signs, decimals, etc... the xml data for that field isn't being written to the xml file. All of the other fields are being written properly.
    The next issue we're having is that with HTML forms, when we create a multiline text field we are unable to limit the number of characters that are allowed in the field.
    I'm pretty new with this, so please send some advice my way if you have any.
    Thanks,
    Chad

    Thanks Rakhi, but that did not resolve my issue. Below is new out as per the thread suggestion and this is not what I wanted.:
    "<H>Thank you for choosing Enterprise.</> We look forward to seeing you at 9:00 am on Monday,
    November 28, 2011. This message is to confirm you have updated your reservation.
    Following are the details for the updated reservation:
    P.S. Remember us when you're renting in town. Enterprise is always nearby at more than 6,500
    neighborhood locations."
    - shalini

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

  • Help...  Populate pdf form fields with html form inputs.

    I have a website that allows users to choose the pdf document they want and create. After selecting which pdf they want to create they are redirected to a web page with a html form. The html form has questions that corresponds with the the form fields of the pdf document the user selected. When submitted the code (ASP, PHP whatever is the easier) runs a script that populates the pdf document form fields. The user is then prompted if they want to save or open the document. The newly created pdfs and the user inputs do not need to be saved on the server.
    I create the pdf templates using PDF 6.0 professional
    Server can be windows or linux
    I understand ASP a little but will use whatever is feasible
    Purchasing a program is okay as long as its reasonable and is changeable by me and I have full control.
    Any help would be appreciated...
    Thanks,
    John

    Try the Developers/SDK forum...
    This forum is for questions about the PDF Language itself.
    Leonard

  • Help with html / php contact form

    Hi guys I was hoping to get some help with a contact form on my website, to be honest I havent a clue about php but kind of okay with html thats why the php code is just a copy and paste from some website, just trying to marry it up with the html but getting errors.
    Hopfully one of you can see the problem.
    Error on Submitting:
    Notice: Undefined variable: name in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 69
    Notice: Undefined variable: message in \\nas44ent\Domains\g\gethinhayman.co.uk\user\htdocs\send_form_email.php on line 75
    We are very sorry, but there were error(s) found with the form you submitted. These errors appear below.
    The Name you entered does not appear to be valid.
    The Comments you entered do not appear to be valid.
    HTML Code:
    <section id="contact" class="four">
                                                                <div class="container">
                                                                          <header>
                                                                                    <h2>Contact</h2>
                                                                          </header>
                                                                          <form method="post" action="send_form_email.php">
                                                                                    <div class="row half">
                                                                                              <div class="6u"><input type="text" class="text" name="name" placeholder="Name" /></div>
                                                                                              <div class="6u"><input type="text" class="text" name="email" placeholder="Email" /></div>
                                                                                    </div>
                                                                                    <div class="row half">
                                                                                              <div class="12u">
                                                                                                        <textarea name="message" placeholder="Message"></textarea>
                                                                                              </div>
                                                                                    </div>
                                                                                    <div class="row">
                                                                                              <div class="12u">
                                                                                                        <a href="http://www.mywebsite.co.uk/email_form.php" class="button submit">Send Message</a>
                                                                                              </div>
                                                                                    </div>
                                                                          </form>
                                                                </div>
                                                      </section>
    php Code:
    <?php
    if(isset($_POST['email'])) {
        $email_to = "my email address";
        $email_subject = "Mail from Site";
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        // validation expected data exists
        if(!isset($_POST['name']) ||
            !isset($_POST['email']) ||
            !isset($_POST['message'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');      
        $first_name = $_POST['name']; // required
        $email_from = $_POST['email']; // required
        $comments = $_POST['message']; // required
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
        $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
        $string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$name)) {
        $error_message .= 'The Name you entered does not appear to be valid.<br />';
      if(strlen($message) < 1) {
        $error_message .= 'The Comments you entered do not appear to be valid.<br />';
      if(strlen($error_message) > 0) {
        died($error_message);
        $email_message = "Form details below.\n\n";
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        $email_message .= "Name: ".clean_string($name)."\n";;
        $email_message .= "Email: ".clean_string($email)."\n";
        $email_message .= "Message: ".clean_string($message)."\n";
    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    ?>
    <?php
    ?>

    PHP CODE:  SaveAs send_form_email.php
    <?php
    if(isset($_POST['email'])) {
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "[email protected]";
        $email_subject = "Your email subject line";
        function died($error) {
            // your error code can go here
            echo "We are very sorry, but there were error(s) found with the form you submitted. ";
            echo "These errors appear below.<br /><br />";
            echo $error."<br /><br />";
            echo "Please go back and fix these errors.<br /><br />";
            die();
        // validation expected data exists
        if(!isset($_POST['name']) ||
            !isset($_POST['email']) ||
            !isset($_POST['message'])) {
            died('We are sorry, but there appears to be a problem with the form you submitted.');     
        $name = $_POST['name']; // required
        $email_from = $_POST['email']; // required
        $comments = $_POST['message']; // required
        $error_message = "";
        $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
      if(!preg_match($email_exp,$email_from)) {
        $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
        $string_exp = "/^[A-Za-z .'-]+$/";
      if(!preg_match($string_exp,$name)) {
        $error_message .= 'The Name you entered does not appear to be valid.<br />';
      if(strlen($message) < 2) {
        $error_message .= 'The message you entered does not appear to be valid.<br />';
      if(strlen($error_message) > 0) {
        died($error_message);
        $email_message = "Form details below.\n\n";
        function clean_string($string) {
          $bad = array("content-type","bcc:","to:","cc:","href");
          return str_replace($bad,"",$string);
        $email_message .= "Name: ".clean_string($name)."\n";
        $email_message .= "Email: ".clean_string($email_from)."\n";
        $email_message .= "Message: ".clean_string($message)."\n";
    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers);
    ?>
    <!-- include your own success html here -->
    Thank you for contacting us. We will be in touch with you very soon.
    <?php
    ?>
    HTML Code -- save as html page.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Contact Form</title>
    </head>
    <body>
    <section id="contact" class="four">
    <div class="container">
    <header>
    <h2>Contact</h2>
    </header>
    <form method="post" action="send_form_email.php">
    <div class="row half"> <div class="6u">
    <input type="text" class="text" name="name" placeholder="Name" />
    </div>
    <div class="6u">
    <input type="text" class="text" name="email" placeholder="Email" />
    </div>
    </div>
    <div class="row half"> <div class="12u">
    <textarea name="message" placeholder="Message"></textarea>
    </div>
    </div>
    <div class="row">
    <div class="12u">
    <input type="submit" name="submit" value="Send">
    </div>
    </div>
    </form>
    </div>
    </section>
    </body>
    </html>
    Upload both to your Apache server to test.
    EDIT:  changed typo on Submit button -- valuse to value.
    Nancy O.

  • Need help with PHP form processor coding

    I posted my first question on this forum earlier today and got help quickly. I'm going to try again and see who can help me this time.
    I have a customer feedback form that I designed and I am using Spry validation on the fields and I'm use Recaptcha as well. Now I'm trying to get the form handler working. I know there are some canned procedures out there but I hate using too much code that I don't understand at all.  I'm sure my first attempt at PHP coding is horrible but we all have to learn. My processor is working in some areas but there are holes I don't know how to fill in:
    1. When I validate the Recaptcha input, if it was entered correctly, I go on to send an email to the appropriate person BUT how do I send them a message and get back to the form if the recaptcha validation fails and still have their entries in place?
    2. Assuming the recaptcha validated correctly, my procedure sends an email  and it writes the comments to a file for historical purposes. These parts seem to be working (by some miracle). Once I do this, I think I would like to open a little window to send the customer a confirmation message, have them click the box to confirm and close the window and then take them back to the feedback form but now have it be reset. I'm not sure how to do these steps.
    Does anyone have a SIMPLE example to accomplish these steps?
    Thanks much!!
    Donna

    It would be hard to give you substantive examples of how to accomplish your goals here without seeing your PHP code, but in general the following methods would work:
    1.  To return to the form with the fields populated, is easiest when the processing script and the form code are on the same page.  The idea is that when the form is not properly completed, you fall back into the form code and use the data from the posted values to repopulate the fields, e.g.,
    <input type="text' name="whatever" value="<?php isset($_POST['whatever']) { echo $_POST['whatever']; ?>">
    or
    <select name="whatever2">
    <option<?php if(isset($_POST['whatever2']) && $_POST['whatever2']=='this_option_value') { echo ' selected="selected"'; } ?>>this_option_value</option>
    </select>
    Each field is set to repeat the posted data (if the corresponding $_POST value is set - to avoid error messages when the page is first loaded).
    2.  You can place the confirmation message on the page with CSS that hides it.  When the form is submitted successfully, just set a variable that is used to show the previously hidden message, e.g.,
    Assume the following CSS -
    #message { display:none; }
    and the following HTML -
    <p id="message">Congratulations</p>
    and the fact that you have set a PHP variable called $success to be true when the form is successfully submitted, you would just modify the HTML like this -
    <p id="message"<?php if($success) { echo ' style="display:block"; } ?>>Congratulations</p>
    Make sense?

  • 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 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.

  • 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

  • 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 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 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>

  • Urgent :post xml for xsql difference with html form post

    Hi,
    We are developing an application to process xml request
    posted by external party. The requests arrive by
    http-post operation
    We developed and tested with an html-form.
    Now we encounter problems in testing with http-post
    The xsql page is processed correctly but
    insert only fixed text when formatting xml-data as input for
    the insert-request, string inserted is empty.
    Everything is by the book and html-forms works great.
    Is anybody else using xsql to insert xml data in the database on this version? Maybe can you help by looking into a testcase ? Issued a tar but am on terrible deadline
    so need help very soon.
    Details: HP-UX 11.11 Oracle 9.2.0.4 java1.4 ojdbc 1.4
    Tnx in advance,
    Jeroen

    Mark,
    Have an external partner which sends xml-requests.
    Have to read those, store them and process them.
    Idea is let them
    1)post the xml at a url where an xsql page is reading the xml
    2) transforming this for an insert into
    the database. The column is defined to store the complete xml-message.
    3) A trigger takes care of processing the stuff and preparing the output
    4) and a query in the xsql-page reads the output from an output table
    When developing and testing this with an html-form that posts the xml is works great.
    $ cat newclobins.xsql
    <?xml version="1.0"?>
    <page connection="demo" xmlns:xsql="urn:oracle-xsql" >
    <xsql:set-session-param name="id">
    select msgid.nextval from dual
    </xsql:set-session-param>
    <xsql:dml>
    delete cbs_msg_in where id={@id}
    </xsql:dml>
    <xsql:insert-request table="cbs_msg_in" column="id,msg" transform="cbsform_1.xsl"/>
    <data>
    <xsql:query null-indicator="yes">
    select msgid,msg from cbs_xml_out where msgid={@id}
    </xsql:query>
    </data>
    </page>
    $ cat cbsform_1.xsl
    <?xml version="1.0"?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="request">
    <ROW>
    <MSG><xsl:value-of select="parameters/doc" /></MSG>
    <ID><xsl:value-of select="session/id" /></ID>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    1) When using a tool like
    http://www.programmersheaven.com/articles/adrian/getpost/article.html it fails with
    No rows to modify -- the row enclosing tag missing. Specify the correct row enclosing tag.
    2) When using the commandline utility like
    xsql jeroen5.xsql posted-xml=test3.xml
    this works great when inserting plain text but not
    when inserting xml-format data into a column
    So problem 1 is why external tools like above or my partner that uses .net to do something similar gives this strange error?
    Problem nr 2 is should I stick to just the data in xml and forget about storing the xml-formatted data?
    Hope you can help because I am getting quite desparate here.
    Regards,
    Jeroen

Maybe you are looking for

  • 'No Airport Networks in Range' on OS 10.1 PowerBook G4 550MHz

    Hi there, I have searched these forums and checked the FAQs without any luck finding this problem. I am working on a PowerBook G4 550MHz that used to have OS 10.4.8 and when you would click on the wireless icon it would report 'No Airport Networks in

  • Export to PDF fails for some reports, but report viewer works

    Hi all Our application produces several different reports. - Report A can successfully be viewed in the ASP.NET report viewer control and can be exported to PDF - Reports B and C can successfully be viewed in the ASP.NET report viewer (all pages),  b

  • Can I change the dashed line between pages in 2up Display mode?

    Did anyone ever figure out an answer to this query: Remove dashed page lines in two up mode? Or did it get fixed or modifiable in a later version? I'm viewing a pdf in two-up mode and I hate the dashed line Acrobat uses to indicate the gutter line be

  • Anyone help with this PL\SQL function

    I have this function which goes through my table form and comapares the row to see if the attrubte super type has been set to confimed. If it has then it should add one to the current allocation and minus one from the slots left. But i have these err

  • Portrait Printing Problem Work-Around

    One of the problems that appeared with iCal 2 (I'm using 2.0.2 for this work-around) in Tiger is the inability to print Month and Week views in Portrait mode. iCal automatically rotates the paper to landscape mode, even if you create custom paper siz