ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have tried to make a comment box and form on my website, with a "Submit" button and a "Reset" button. What I would like to know though is how to make the form work so that the data is stored somewhere or forwarded to an email address. I would also like the user to be redirected to another page once they have clicked on the Submit button. Here is my code:
Where you have action="" in your form tag, if you want the form to be mailed, you need to have action="mailto:<email address>", but without the angle brackets. For redirection, I don't think it's possible with just HTML. You might need to use something like PHP or ASP.
EDIT: the simplest way to do this would to have the mailto option, and then to redirect, to have a javascript (security guys can hush!) function that would run as the submit button was clicked.
seriously though, many people disable javascript to avoid unfun stuff like popups..
Last edited by titanium_geek; 06-30-2005 at 01:12 PM.
Thanks to both of you! I'm looking to host this on an internet web hosting site (yahoo), but tried it by previewing the page (with the mailto value in "Action"), but it just came up with my standard email program with the subject "Form Post From Mozilla" and the text
I had a feeling it wouldn't send the email automatically (because there are no SMTP details configured), so how would I store it into a database? I had a look at your links titanium_geek, but how would I use (for example, a PHP script) on the web hosting company's server? I'm sorry, I don't really understand much about PHP or other scripting languages yet!
What would be the simplest way for me to save the comments in the form straight to a database which would be within the web folder, but only I would be able to (i.e possibly password protected)? Thanks, and I'm sorry I don't really understand the scripting languages!
if you are using yahoo's free hosting, then get the form (perhaps called the guestbook) stuff from them. hosting like them is picky about other scripts on thier servers...
Hmmmm...this is more complicated than I thought it would be. I tried Yahoo's form->email script but I'm not very sure about it. I understand how complicated it must be to make a database and then make the form write to that database, but I'm willing to learn. I have found this tut which involves Perl and stuff but I'd much rather a database which the forms store data to....am I trying to run before I can walk?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.