Register

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

Results 1 to 9 of 9
  1. #1
    Junior Member Griff's Avatar
    Join Date
    Oct 2003
    Posts
    14
    Member #
    3720
    I want to make a simple form whis has 2 fields.....

    1. Email address (Text Box)
    2. State (drop down box)

    So a text boxe and a drop down box, with a submit button, which sends to one of my email addresses....

    Can someone help me out with the script needed... :classic:

    Thank you very much

  2.  

  3. #2
    Senior Member glyakk's Avatar
    Join Date
    Nov 2003
    Location
    USA
    Posts
    1,263
    Member #
    3828
    Liked
    6 times
    There are thousands of them out there.. Here is one from Hotscrips.com if you have php installed on your server.


  4. #3
    Junior Member Griff's Avatar
    Join Date
    Oct 2003
    Posts
    14
    Member #
    3720
    Thanks glyakk,

    I will give it a go


  5. #4
    Senior Member teal's Avatar
    Join Date
    Dec 2003
    Posts
    247
    Member #
    4319
    You are going to have to use something other then HTML/CSS for this. It is fairly easy to do in PHP
    Code:
    <form name="form" method="post" action="actionpage.php">
      <br>
        <input type="text" name="email" value="Email goes here">
      <br>
        <select name="state">
          <option name="ny" selected>NY</option>
          <option name="nc">NC</option>
          <option name="va">VA</option>
          <option>other states . . .</option>
        </select>
    </form>
    then on your actionpage.php . . .
    PHP Code:
    <html>
    <head>
    <title>Sending mail</title>
    </head>

    <body><?PHP
    //Who recieves:
    $mailTo "Admin <{$_SERVER["SERVER_ADMIN"]}>";
    //Define Subject
    $mailSubject "subject";
    //Write body
    $mailBody "Email = $email";
    //Add more to body
    $mailBody .= "State = $state";
    //Add a from header
    $mailHeaders "From: $email"<php@{$_SERVER["SERVER_NAME"]}>\r\n";
    //The send mail . . .
    if (mail($mailTo$mailSubject$mailBody$mailHeaders))
    {
        print (
    "Mail was sent");
    }
    else
    {
        print (
    "Mail wasn't sent");
    ?>
    </body>
    </html>
    Sorry if this doesn't work, I didn't have time to check it.
    Whoth steps forth to mock the teal? Whom couldst say a color superior!

    Proclamith me, it cannot be done.

  6. #5
    Member Skotster's Avatar
    Join Date
    Jan 2004
    Posts
    43
    Member #
    4675
    the php shoud theoriticaly work from what i see
    you could make it simpler by just putting
    Code:
     action="mailto:youemail@yourdomain.com?subject=YourSubject"
    in your form tags
    Rembember, You're Unique
    Just Like Everybody Else

  7. #6
    Senior Member teal's Avatar
    Join Date
    Dec 2003
    Posts
    247
    Member #
    4319
    Hmm. Suppose that is simpler. Mine is prettier though!
    Whoth steps forth to mock the teal? Whom couldst say a color superior!

    Proclamith me, it cannot be done.

  8. #7
    Senior Member jlgosse's Avatar
    Join Date
    Jan 2004
    Location
    Newfoundland, Canada
    Posts
    1,037
    Member #
    4570
    Liked
    7 times
    You can do SO MUCH MORE with the mail(); function that you can with just a plain action.

    But yes, I think both would have the same function.


  9. #8
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    PHP Code:
    //Who recieves:
    $mailTo "Admin <{$_SERVER["SERVER_ADMIN"]}>"
    Do I replace 'Admin' with my email address?
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  10. #9
    Senior Member jlgosse's Avatar
    Join Date
    Jan 2004
    Location
    Newfoundland, Canada
    Posts
    1,037
    Member #
    4570
    Liked
    7 times
    I don't think so.



Remove Ads

Posting Permissions

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