tecra134 Posted February 1, 2008 Share Posted February 1, 2008 I'm trying to make a form that a person can fill out. When they click submit, it will send what they wrote to me in a e-mail.This is what I have: <form action = "MAILTO:E-mail" method = "post" enctype = "text/plain">alkdsjflasjalsdjflasdjfa;lkdfalsdj</form><input type = "submit"> What I dont like that this does, is it opens the microsoft outlook express. I want it to send me the form information without opening outlook express.I would like it to send the form to my e-mail, and also redirect them to a different page. Link to comment Share on other sites More sharing options...
Ingolme Posted February 1, 2008 Share Posted February 1, 2008 You would have to use a server-side language, like PHP.http://w3schools.com/php/php_secure_mail.asp Link to comment Share on other sites More sharing options...
tecra134 Posted February 1, 2008 Author Share Posted February 1, 2008 You would have to use a server-side language, like PHP.http://w3schools.com/php/php_secure_mail.asp This might sound crazy, but I had it working before.(Using just HTML)It wouldn't open outlook express, it would just send it, then redirect to a different page. I lost all the code, and I don't remember how I did it. Link to comment Share on other sites More sharing options...
Ingolme Posted February 1, 2008 Share Posted February 1, 2008 This might sound crazy, but I had it working before.(Using just HTML)It wouldn't open outlook express, it would just send it, then redirect to a different page. I lost all the code, and I don't remember how I did it.Well, that's just not logically possible. HTML does nothing on its own. HTML is not a programming language. It just tells the browser how to display the page. Link to comment Share on other sites More sharing options...
tecra134 Posted February 1, 2008 Author Share Posted February 1, 2008 Could Java Script do something similar? Link to comment Share on other sites More sharing options...
Ingolme Posted February 1, 2008 Share Posted February 1, 2008 Only a server-side language, like PHP, can do it.Maybe something like this: <?php if($_GET['send'] == "true") {// Code to send mail}?><form action="?send=true" mathod="post"><!-- HTML form -->......</form> Link to comment Share on other sites More sharing options...
jlhaslip Posted February 1, 2008 Share Posted February 1, 2008 Are you mixing the Get and POST methods there? Link to comment Share on other sites More sharing options...
Ingolme Posted February 1, 2008 Share Posted February 1, 2008 Are you mixing the Get and POST methods there?No, not at all, I use a GET variable to indicate that I want to process the form.I use the post variables to send the form data itself.It could also be done with a POST variable, only to do that I'd have to add an<input type="hidden" name="send" value="true"> Link to comment Share on other sites More sharing options...
tecra134 Posted February 1, 2008 Author Share Posted February 1, 2008 I tried what is on w3schools. (The PHP) <html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "someone@example.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; }?></body></html> I replaced my e-mail of course I couldn't get it to work. Do I need to modify anything on this to make it work? Link to comment Share on other sites More sharing options...
Ingolme Posted February 1, 2008 Share Posted February 1, 2008 I tried what is on w3schools. (The PHP)<html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "someone@example.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; }?></body></html> I replaced my e-mail of course I couldn't get it to work. Do I need to modify anything on this to make it work? Rather than $_REQUEST, try $_POST.And check to see if your file is actually called "mailform.php" Link to comment Share on other sites More sharing options...
Synook Posted February 2, 2008 Share Posted February 2, 2008 Also check, of course, that you have the page on a functioning server with PHP installed and that you named the form fields correctly. Link to comment Share on other sites More sharing options...
tecra134 Posted February 3, 2008 Author Share Posted February 3, 2008 I'm sorry but I am really new to PHP. When you say is the file really named mailform.php, do you mean the actual page?I am using geocities as my web server, they do support PHP. Link to comment Share on other sites More sharing options...
boen_robot Posted February 3, 2008 Share Posted February 3, 2008 I am using geocities as my web server, they do support PHP.No they don't. Not their free offers, that's for sure. I don't know about the paid ones. Link to comment Share on other sites More sharing options...
tecra134 Posted February 4, 2008 Author Share Posted February 4, 2008 No they don't. Not their free offers, that's for sure. I don't know about the paid ones.Is there anybody that offers free web hosting that allows PHP? Link to comment Share on other sites More sharing options...
Ingolme Posted February 4, 2008 Share Posted February 4, 2008 I find this one to be very good. They don't put ads on your site: http://byethost.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.