Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I link "submit" button to email address?

    I'm a real novice and have bolted this site together for my wife. But I have hit a real problem.
    Since downloading this form http://aceinfowayindia.com/blog/2009...#comment-13271 I have been unsuccessful in trying to link the "SUBMIT" button to my email address.
    I'd be very grateful of any advice on how to do this.

    Many thanks

    Paul
    Last edited by Fou-Lu; 10-10-2010 at 04:00 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Um... unless I'm misunderstanding you, you don't link a submit button to your email addy. The submit button sends the form to a PHP page (presumably since you are putting this in the PHP forum) where your process it, and if you wanna email the form, use the PHP mail function.

    If you have a PHP page and are having trouble getting that working, please show us your code (using the code/php tags as appropriate).

  • #3
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Keleth

    Admittedly I may have posted this in the wrong forum.
    Quite simply, I found the form yesterday and have made minor tweaks for the benefit of my wife's site.
    I have posted the question to a number of forums, incl. CSS/HTML and the only reply I've received so far says that this is a php question.

    Quite simply, the only code I have is as follows - btw, thanks for any further assistance/advice you're able to offer.

    Paul

    CSS





    form,input,select,textarea{
    width:700px;
    margin:auto;
    padding:0;
    }

    div.box {
    margin:0 auto;
    width:500px;
    background:#222222;
    color:#ABDFB4;
    position:relative;
    top:50px;
    background-color: #222222;
    }

    div.box h1 {
    color:#ABDFB4;
    font-size:16px;
    color:#ABDFB4;
    padding:5px 0 5px 5px;
    border-bottom:1px solid #161712;
    border-top:1px solid #161712;
    }

    div.box label {
    width:100%;
    display: block;
    background:#1C1C1C;
    color:#ABDFB4;
    border-top:1px solid #262626;
    border-bottom:1px solid #161712;
    padding:10px 0 10px 0;
    background-color #222222;
    }

    div.box label span {
    display: block;
    color:#ABDFB4;
    font-size:12px;
    color:#ABDFB4;
    float:left;
    width:100px;
    text-align:right;
    padding:5px 20px 0 0;
    }

    div.box .input_text {
    padding:10px 10px;
    width:200px;
    background:#262626;
    color:#ABDFB4;
    border-bottom: 1px double #171717;
    border-top: 1px double #171717;
    border-left:1px double #333333;
    border-right:1px double #333333;
    }

    div.box .message{
    padding:7px 7px;
    width:350px;
    color:#ABDFB4;
    background:#262626;
    border-bottom: 1px double #171717;
    border-top: 1px double #171717;
    border-left:1px double #333333;
    border-right:1px double #333333;
    overflow:hidden;
    height:150px;
    }

    div.box .button
    {
    margin:0 0 10px 0;
    padding:4px 7px;
    background:#262626;
    color:#ABDFB4;
    border:0px;
    position: relative;
    top:10px;
    left:382px;
    width:100px;
    border-bottom: 1px double #ABDFB4;
    border-top: 1px double #ABDFB4;
    border-left:1px double #ABDFB4;
    border-right:1px double #ABDFB4;
    }


    HTML

    <form>

    <div class="box" >
    <h1 align="center">Please complete the boxes below and I'll reply very soon. </h1><br>

    <label>
    <span>Full name</span>
    <input type="text" class="input_text" name="name" id="name"/>
    </label>

    <label>
    <span>Email</span><input type="text" class="input_text" name="email" id="email"/>
    </label>

    <label>
    <span>Tel.No</span><input type="text" class="input_text" name="Tel.no" id="Tel.no"/>
    </label>

    <label>
    <span>Subject</span><input type="text" class="input_text" name="subject" id="subject"/>
    </label>

    <label>
    <span>Message<br><br>PLEASE NOTE: <br>This page is currently offline for maintenance.</span><textarea class="message" name="feedback" id="feedback"></textarea>

    <input type="submit" class="button" value="Please Submit" />
    </label>

    </div>
    </form>

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    The form you currently have should probably be set as a method="post" instead of the default get. The action is optional, but will post back to this form.

    From the HTML to PHP world, the HTML form is filled out on the client and the submit sends it back to the provided action or to the originating page if action is not specified. It will include the fields: name, email, Tel_no, and subject. Note the change in Tel_no, you cannot have a . in your name, which is converted (as an external variable) to _. For more information on this, refer to: http://php.ca/manual/en/language.variables.external.php
    Now, the email itself is done with the mail() command. Let me find a couple of tutorials.

    http://www.tutorialized.com/view/tut...act-form/10731
    That one is good, but doesn't provide any type of security.

    http://www.thesitewizard.com/php/pro...njection.shtml
    How to prevent email injections
    http://safalra.com/programming/php/c...feedback-form/
    And a bit on general mail security.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Many thanks Fou-Lu for providing so much information. I'm very grateful.

    Now off to read a little.

    Paul


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •