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>
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.
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.
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?
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.
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?
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.
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")' .
Bookmarks