SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Thread: HTML Form Help?

  1. #1
    SitePoint Enthusiast Cole_21's Avatar
    Join Date
    Dec 2004
    Location
    Dallas, TX
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HTML Form Help?

    Can someone help me with html forms?

    The form is already built, I just need someone to help me get it working correctly.

    Thanks,
    Cole

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi. What are you trying to achieve?

  3. #3
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,466
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Post your problem exactly with your code and we will be happy to help you.
    Sara

  4. #4
    SitePoint Enthusiast Cole_21's Avatar
    Join Date
    Dec 2004
    Location
    Dallas, TX
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok here goes:
    form>
    <table><tbody><tr><td>
    <table style="top: 489px; height: 921px;" cellspacing="1" cellpadding="6" border="0"><tbody><tr><td colspan="2" class="formTDright">Required Fields Are Marked With A Blue Asterisk&nbsp;<font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    First Name: </td><td class="formTDright">
    <input type="text" tabindex="1" name="sFirstName" size="30" maxlength="75" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Last Name:
    </td><td class="formTDright">
    <input type="text" tabindex="2" name="sLastName" size="30" maxlength="75" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Address:
    </td><td class="formTDright">
    <input type="text" tabindex="3" name="sAddress" size="30" maxlength="255" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    City:
    </td><td class="formTDright">
    <input type="text" tabindex="4" name="sCity" size="30" maxlength="100" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    State:
    </td><td class="formTDright"><select tabindex="5" name="sState" size="1">
    <option value="">Please Select</option>
    <option value="non-usa">-- Not In USA --</option>
    <option value="AL">Alabama</option>
    <option value="AK">Alaska</option>
    <option value="AZ">Arizona</option>
    <option value="AR">Arkansas</option>
    <option value="CA">California</option>
    <option value="CO">Colorado</option>
    <option value="CT">Connecticut</option>
    <option value="DE">Delaware</option>
    <option value="DC">District of Columbia</option>
    <option value="FL">Florida</option>
    <option value="GA">Georgia</option>
    <option value="HI">Hawaii</option>
    <option value="ID">Idaho</option>
    <option value="IL">Illinois</option>
    <option value="IN">Indiana</option>
    <option value="IA">Iowa</option>
    <option value="KS">Kansas</option>
    <option value="KY">Kentucky</option>
    <option value="LA">Louisiana</option>
    <option value="ME">Maine</option>
    <option value="MD">Maryland</option>
    <option value="MA">Massachusetts</option>
    <option value="MI">Michigan</option>
    <option value="MN">Minnesota</option>
    <option value="MS">Mississippi</option>
    <option value="MO">Missouri</option>
    <option value="MT">Montana</option>
    <option value="NE">Nebraska</option>
    <option value="NV">Nevada</option>
    <option value="NH">New Hampshire</option>
    <option value="NJ">New Jersey</option>
    <option value="NM">New Mexico</option>
    <option value="NY">New York</option>
    <option value="NC">North Carolina</option>
    <option value="ND">North Dakota</option>
    <option value="OH">Ohio</option>
    <option value="OK">Oklahoma</option>
    <option value="OR">Oregon</option>
    <option value="PA">Pennslyvania</option>
    <option value="RI">Rhode Island</option>
    <option value="PR">Puerto Rico</option>
    <option value="SC">South Carolina</option>
    <option value="SD">South Dakota</option>
    <option value="TN">Tennessee</option>
    <option value="TX">Texas</option>
    <option value="UT">Utah</option>
    <option value="VT">Vermont</option>
    <option value="VA">Virginia</option>
    <option value="WA">Washington</option>
    <option value="WV">West Virginia</option>
    <option value="WI">Wisconsin</option>
    <option value="WY">Wyoming</option>
    <option value="APO AP">APO AP</option>
    <option value="APO AE">APO AE</option>
    <option value="FPO AP">FPO AP</option>
    <option value="APO AA">APO AA</option></select> </td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Zip:
    </td><td class="formTDright">
    <input type="text" tabindex="6" name="sZip" size="30" maxlength="50" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft"> County:
    </td><td class="formTDright">
    <input type="text" tabindex="7" name="sCounty" size="30" maxlength="100" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft" colspan="2">
    Who Are You?:
    </td></tr><tr><td nowrap="nowrap" class="formTDright" colspan="2">
    <table><tbody><tr><td align="left"><select tabindex="8" name="sWhoAreYou">
    <option value="|Builder|">Builder</option>
    <option value="|Homeowner|">Homeowner</option>
    <option value="|Property Manager|">Property Manager</option></select></td></tr></tbody></table></td></tr><tr><td nowrap="nowrap" class="formTDleft" colspan="2">
    What Type Of Project Is This?</td></tr><tr><td nowrap="nowrap" class="formTDright" colspan="2"><select name="sType">
    <option value="NewTile~New Construction - Tile">New Construction - Tile</option>
    <option value="NewShingle~New Construction - Shingle">New Construction - Shingle</option>
    <option value="Reroofing~Residential Re-roofing">Residential Re-roofing</option>
    <option value="Commercial~Commercial">Commercial</option>
    <option value="Gutters~Gutters">Gutters</option></select></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Phone:
    </td><td class="formTDright">
    <input type="text" tabindex="10" name="sPhone" size="10" maxlength="15" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Email:
    </td><td class="formTDright">
    <input type="text" tabindex="11" name="sEmail" size="30" maxlength="65" value=""><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" class="formTDleft"> Fax:
    </td><td class="formTDright">
    <input type="text" tabindex="12" name="sFax" size="10" maxlength="15" value=""></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Mobile Phone/Nextel:
    </td><td class="formTDright">
    <input type="text" tabindex="13" name="sCell" size="30" maxlength="50" value=""></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    Best Way:
    </td><td class="formTDright"><select tabindex="13" type="text" name="sBestWay">
    <option value="">Please Select</option>
    <option value="Email">E-mail</option>
    <option value="Phone">Phone</option>
    <option value="Fax">Fax</option>
    <option value="Cell">Cell</option></select><font color="#0000ff">*</font></td></tr><tr><td nowrap="nowrap" colspan="2" class="formTDleft">
    Description:
    </td></tr><tr><td align="center" colspan="2" class="formTDright"> <textarea tabindex="15" name="sDescription" rows="6" cols="47"></textarea></td></tr><tr><td nowrap="nowrap" class="formTDleft">
    How Did You Hear About Us:
    </td><td class="formTDright"><select tabindex="16" name="sHowDidYouHearAboutUs">
    <option value="">Please Select</option>
    <option value="Everybody's Business">Everybody's Business</option>
    <option value="Web Search">Web Search</option>
    <option value="Personal Referral">Personal Referral</option>
    <option value="Truck Signage">Truck Signage</option>
    <option value="Yard Sign">Yard Sign</option>
    <option value="Other - Please Specify Below">Other - Please Specify Below</option></select></td></tr><tr><td valign="middle" align="center" colspan="2">
    <input type="submit" border="0" tabindex="17" class="submitButton" value="Submit >>>"></td></tr></tbody></table>
    <table cellspacing="1" cellpadding="6" border="0" align="center"></table></td>

    I want to know when someone hits send it will send me an email with all of the information they filled out.

    I am lost.

  5. #5
    SitePoint Wizard rbutler's Avatar
    Join Date
    Jul 2003
    Location
    Springfield, MO
    Posts
    1,867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cole_21
    I want to know when someone hits send it will send me an email with all of the information they filled out.

    I am lost.
    You will need to add an action and method call to your opening form tag:

    <form action="result.php" method="post">

    Or you can specify:

    <form action="mailto:you@domain.com" method="post">

    The problem with the second method is the output you receive from visitor's will not be formatted in any usable or readable format. The best approach is to use the first method in combination with a script either in PHP, ASP, ASP.NET to accomplish this task of emailing you the results of the visitor's input.

    Perhaps this article might help you for PHP contact forms:

    http://midwestwebdesign.net/tutorial...orm/index.html

    Does not cover everything, but should get you going. Some PHP'ers might have a problem with how I'm coding it, which they can correct me if necessary.
    Ryan Butler

    Midwest Web Design

  6. #6
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok - so that's why I ask what you want to achieve - to which the answer seems to be "email form data to myself from a website", right?

    There are two ways to do this:

    1. set the form action parameter as a mailto: e.g. <form action="mailto:my@email.com">

    This will cause the form to be submitted to your user's local email client to be sent. The user's Internet browser will warn them the website is trying to send a mail from their machine, and they will have the option to say Yes or No. This will inevitably put a large number of users off for privacy reasons/it's just alarming! It's a fairly cruddy way of doing it, but if you can't implement option 2. it's you only option.

    2. use some kind of server-side technology to send the mail, e.g. ASP, PHP, Perl, etc.

    This is how most websites handle this kind of functionality - it allows users to submit emails without using their own email client, affording more privacy and not requiring any particular software (such as a correctly configured mail client) on the user's computer. However, it relies on you to have a web hosting provider which allows you to use one of these server-side technologies.

    A commonly installed mail script which may well be available to you is a Perl script called FormMail.pl - http://www.scriptarchive.com/formmail.html - you should ask your hosting company if this is available. It is well documented and you should find everything you need to utilise it.

    Failing that, I have also used a PHP script called FormMail.php in the past which is really really easy to configure: http://www.dtheatre.com/scripts/formmail.php

    Basically you need to find out from your hosting company what options are available to you. I'm sure they'll support something you can use.

    Cheers,

    G

  7. #7
    SitePoint Wizard rbutler's Avatar
    Join Date
    Jul 2003
    Location
    Springfield, MO
    Posts
    1,867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whatever you do, if you go with formail.pl, at the very least rename the file, because that script is poorly coded and vulnerable to hackers. You'd be better served by purchasing one if you can't follow my brief articlem, or pay someone to code a customized one for you.
    Ryan Butler

    Midwest Web Design

  8. #8
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Often formmail.pl is universally available on cheaper hosting plans, thus you can't rename it because the same script is used by hundreds of low bandwidth users - I defer to Ryan's knowledge of formmail.pl, as it is not a script I'm familiar with, beyond being aware of it's existence, but it has undergone many many versions over time. Ryan, are you sure the latest release still has security flaws? I haven't heard this before, but like I say, I don't know Perl well enough to comment.

  9. #9
    SitePoint Enthusiast Cole_21's Avatar
    Join Date
    Dec 2004
    Location
    Dallas, TX
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a clone of Formail but have no clue how to set it up.

    I am willing to pay someone who can help me out.

    Thanks,
    Cole

  10. #10
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,468
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cole_21
    I have a clone of Formail but have no clue how to set it up.

    I am willing to pay someone who can help me out.

    Thanks,
    Cole
    If you're going to go down that route, be sure you post an ad on the "Looking to Hire" section of the SitePoint Marketplace so you don't run afoul of the SitePoint staff.

  11. #11
    SitePoint Wizard rbutler's Avatar
    Join Date
    Jul 2003
    Location
    Springfield, MO
    Posts
    1,867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by greg.harvey
    I defer to Ryan's knowledge of formmail.pl, as it is not a script I'm familiar with
    You ought not to defer to my knowledge on this script, especially if its perl.

    Quote Originally Posted by greg.harvey
    Ryan, are you sure the latest release still has security flaws? I haven't heard this before, but like I say, I don't know Perl well enough to comment.
    Last I knew from my previous UNIX host was that it still had security flaws. I don't follow this script because I write my own scripts, whether its PHP or ASP.NET. I'm sure a search on their forums would correct me if I'm wrong. I just didn't want a newbie opening up their site to hackers, because I know for a fact in the past it did. Plus, in my opinion, it was horribly inefficient in those days.

    Cole_21, find out what your host supports, since they have perl, I'm assuming they have PHP. My article provides a free PHP script to use. It certainly does not do everything, but I haven't read about anything I do that causes problems. I would be willing to help you out for free if you can read the article first, do some research and then post back with questions.

    If you would rather someone do it for you, then let me know and we can discuss through PM.
    Ryan Butler

    Midwest Web Design

  12. #12
    SitePoint Wizard rbutler's Avatar
    Join Date
    Jul 2003
    Location
    Springfield, MO
    Posts
    1,867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since I don't want to be in the habit of blasting other people and their code, a little research provided this:

    http://www.wizcrafts.net/fmsec.html

    Although, other sites tend to still think unfairly towards this script. That's my warranty disclaimer I presume
    Ryan Butler

    Midwest Web Design

  13. #13
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice article. Thanks.
    Definitely worth checking the version then - if a lazy hosting company is running an out of date copy then run a mile, as the article states!

    Nice alternative offered too, in the form of NMS:
    http://nms-cgi.sourceforge.net

Bookmarks

Posting Permissions

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