dcsimg
www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: [RESOLVED] Basic Form Question

  1. #1
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75

    resolved [RESOLVED] Basic Form Question

    Hello there, i want to put a form on my contact page where the submit button sends the input to my email. Can somebody help me with this? Here is what i have, but when I hit submit, it opens my email client, i want to avoid that and just have it send and show "your message has been sent" or something like that. any help would be great!

    <CODE>
    <form action="mailto:franny@frannysites.com" method="post" id="shout_out">
    Your Name: <input type="text" name="name" /><br>
    Your Email: <input type="text" name="email" /><br>
    <textarea name="comments" rows="5" columns="200">What's on your mind?</textarea><br>
    <input type="submit" value="Shout it!" id="shout_it_button">
    </form>
    </CODE>

  2. #2
    Join Date
    May 2007
    Location
    Cleveland, OH
    Posts
    1,403
    You would have to use some client side scripting for this, like PHP or ASP. If you know either of those languages its pretty easy to do.

  3. #3
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75
    well i saw the sticky post that actually answers this question, so i tried the following suggestion:

    <input type="hidden" name="form_email" value="YOUR_EMAIL@DOMAIN" /><br />
    <input type="hidden" name="form_thankyou" value="http://www.YOURSITE.com/THANKYOUPAGE.HTML" /><br />

    but i just get a "problem loading page" which is unfortunate.

  4. #4
    Join Date
    Aug 2006
    Posts
    1,942
    I suspect you missed changing the "<form action....> line in your HTML, to whatever that sticky said. It will point the action at a server script, and you need that script to be able to run on your server. Start with finding out what languages are supported on the server, then you'll know what language your script must be in.

    Dave

  5. #5
    Join Date
    Mar 2007
    Location
    Orlando
    Posts
    670
    You can't do that with HTML. You will need some sort of server side scripting. There are sgi scripts that you can use to handle this or there are third party sites that you can submit the form to and they will handle the email generation.

  6. #6
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75

    Post thanks for the attention

    I then tried the php script (my server does support it) filled it out and labeled the file "feedback.php" and but it in the cgi_bin folder on my server. I then put the following form in my HTML:

    <form action="/cgi_bin/feeback.php" method="post" id="shout_out">
    Your Name: <input type="text" name="name" /><br>
    Your Email: <input type="text" name="email" /><br>
    <textarea name="comments" rows="5" columns="200">What's on your mind?</textarea><br>
    <input type="submit" value="Shout it!" id="shout_it_button">
    </form>

    and got two errors:
    The requested URL /cgi_bin/feeback.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    I tried running this as method POST and GET. Am i missing something in my HTML?

  7. #7
    Join Date
    Aug 2006
    Posts
    1,942
    It's telling you it can't find the feedback.php file. Try putting the entire url (http:///blah.com/cgi_bin/feedback.php) into the action, just to make sure it's pointing at the right place. Also give us the URL to the site so we can look at the actual stuff, not pieces of it.

    Dave

  8. #8
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75
    sure the site is http://frannysites.com and you can check out where the form is located at:

    http://frannysites.com/contact.html

    and i tried to put the full URL in

  9. #9
    Join Date
    Aug 2006
    Posts
    1,942
    Could you double check to see that the file is actually on the server, in that directory? I don't believe it is, or possibly it has odd permissions.

    Dave

  10. #10
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75
    basically what i did was went to the file, right-clicked and copied the "fetch address" and corrected from an ftp address to an http address. So the file is there and i'm sure the path is correct. I also triple checked my server and php is supported. if the PHP file had an error in it, say, maybe there is a mimssing tag, could it generate this error? For example, it could be labeled .php but maybe be missing something that makes the file invalid? would it generate the same error?

  11. #11
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75
    take that back, the server says the document type is a "php: hypertext preprocessor (php) document

  12. #12
    Join Date
    Aug 2006
    Posts
    1,942
    You might try pulling it out of the cgi_bin directory (it is neither cgi nor binary) and just put it in your top level directory. There could be a permission set on that directory which is causing the issue.

    Dave

  13. #13
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75
    yes i tried that, and i even attempted to make it it's own folder and setting the path.

  14. #14
    Join Date
    Nov 2006
    Location
    Nevada City, CA
    Posts
    75

    Unhappy it's on the server

    here's a snapshot and you'll see that the file is #7 in the list and i set the path appropriately.
    Attached Images Attached Images

  15. #15
    Join Date
    May 2007
    Location
    Cleveland, OH
    Posts
    1,403
    Make sure you use relative paths. If it's a linux server 'include("/cgi-bin/feedback.php")' will be referring to the server root. So instead use 'include("../cgi-bin/feedback.html")' .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles