'contact us' form script needed

Discussion in 'HTML & Website Design' started by olang, Apr 19, 2007.

  1. #1
    HI, can someone help?

    I need a script for 'contact us' form and don't know html.

    My host go daddy doesn't provide scripting service.

    I need a form that says :
    name :
    email :
    country :
    message : text box

    This is the sample script given by go daddy:
    <form action="gdform.asp" method="post">
    <input type="hidden" name="subject" value="Form Submission">
    <input type="hidden" name="redirect" value="thankyou.html">
    <input name="FirstName">
    <br>
    <input name="LastName">
    <br>
    <input name="email">
    <br>
    <textarea name="comments" cols="40" rows="10"></textarea>
    </form>

    pls let me know where I shall insert my details like email address, domain name.
    tks for your help
     
    olang, Apr 19, 2007 IP
  2. missdanni

    missdanni Guest

    Best Answers:
    0
  3. .mystical

    .mystical Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is fairly xsimple. I can give it ago in Dreamweaver later today and share the codin g with you.
     
    .mystical, Apr 19, 2007 IP
  4. PHPGator

    PHPGator Banned

    Messages:
    4,437
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    260
    #4
    You will need to add more <option> tags in the Main file for more countries.
    You will need to edit the line in process.php file starting with mail() to include your email address and the subject you want the email to have.

    Hopefully this helps. Some editing may be necessary to get it to look correctly in your website.

    Main File:
    
    <form action="process.php" method="post">
    Name: <input type="text" name="name"><br>
    Email: <input type="text" name="email"><br>
    Country: <select name="country"><option value="United States">United States</option><option value="Canada">Canada</option></select><br>
    Message: <textarea rows="5" cols="30" name="message"></textarea>
    
    
    process.php File
    
    <?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $country = $_POST['country'];
    $message= $_POST['message'];
    
    $completeemail = "Name: ".$name."\nEmail: ".$email."\nCountry: ".$country."\nMessage: ".$message;
    
    mail( "email@email.com", "Email Subject", $completeemail, "From: $email");
    print("You have successfully sent a Contact Form.");
    ?>
    Code (markup):
     
    PHPGator, Apr 19, 2007 IP
  5. sujit001

    sujit001 Peon

    Messages:
    186
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thats the correct script
     
    sujit001, Apr 19, 2007 IP
  6. olang

    olang Peon

    Messages:
    128
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks.
    I want to have the whole list of countries there, any ready script that I can pluck in?
    where do i insert this "<form action="gdform.asp" method="post"> " which is godaddy's form code?

    and my email address and my domain? where do they go?

    tks
     
    olang, Apr 19, 2007 IP
  7. shezz

    shezz Peon

    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    phpgator - do you just need the 2 files and that's it? Main File - that's the page we want the details to appear on is that right?

    I tried doing one of these through fantastico and I could not for the life of me work it out. What you have there looks heaps more simple than the fantastico one, I downloaded theirs and there were heaps of files, I didn't know what ones I was supposed to be using - very confusing.
     
    shezz, Apr 19, 2007 IP
  8. ThreeGuineaWatch

    ThreeGuineaWatch Well-Known Member

    Messages:
    1,489
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    140
    #8
    The London Perlmongers released a secure canned script for form mailing. Just search G.
     
    ThreeGuineaWatch, Apr 19, 2007 IP
  9. PHPGator

    PHPGator Banned

    Messages:
    4,437
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    260
    #9
    Yeah, the main file code needs to be inserted into your template. Technically, you could just save this as a file of its own and open it in internet explorer, but it will be ugly and won't fit with your website.

    The process.php file pretty well needs to have the same thing, but it HAS to be named process.php to work properly. The reason is is because once the user submits the form it will go to process.php.

    I can get it setup for you, but since each website is designed differently I can't tell you exactly where to put the code without having access to your web files. :(

    I can do it for you and you can tip me whatever you feel like if you want. ;)
     
    PHPGator, Apr 19, 2007 IP
  10. PHPGator

    PHPGator Banned

    Messages:
    4,437
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    260
    #10

    Ignore Godaddy's code if you are inserting mine. As far as Countries you could go here: http://en.wikipedia.org/wiki/List_of_countries

    This lists all of them, then all you need to do is do:
    <option value="Greece">Greece</option>
    <option value="Italy">Italy</option>

    would be time consuming, but you can do it that way if you want. ;)
     
    PHPGator, Apr 19, 2007 IP
  11. olang

    olang Peon

    Messages:
    128
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I don't see the 'submit form' button after pasting the code. YOu missed that out?
     
    olang, Apr 19, 2007 IP
  12. shezz

    shezz Peon

    Messages:
    64
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Ok, I've had a go at setting it up and I think its ok, just one question - my boxes don't line up very well so looks a bit messy - how do you set it up so the boxes line up?

    the - do I put my email in there? Do I need to have my email in there somewhere for it to send it to me?
     
    shezz, Apr 22, 2007 IP