morgan1122 Posted June 3, 2011 Share Posted June 3, 2011 <div class="common-padding clearfix"> <h4 class="secondary-dark">Welcome</h4> <form method="post" action="[email protected]"> NAME: <input type="text" size="15" maxlength="50" name="name"> <br /><br /> EMAIL: <input type="text" size="15" maxlength="20" name="EMAIL"><br /><br /> AGE: <input type="number" size="15" maxlength="20" name="AGE"> <br /><br /><input type="submit" value="Send"> </form> HOW DO I MAKE THIS SO WHAT EVER YOU SUBMIT SENDS ME AN EMAIL WITH THE ANSWER Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 after they click submit, check the name,email,age... then use php's mail function? Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 (edited) i dont get it soz i am really rubbish at coding Edited June 3, 2011 by morgan1122 Quote Link to comment Share on other sites More sharing options...
Guest LostOne Posted June 3, 2011 Share Posted June 3, 2011 Then why do you not attempt it. As you have stated yourself - you are rubbish at "coding", so surely it would be better if you took the time to attempt to learn it and then if you cannot - come back and ask for assistance. Seriously, if you do not wish to learn, give up your project. Some spelling, punctuation and grammar would not go amiss either :) Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 3, 2011 Share Posted June 3, 2011 (edited) make a mail function if you dont have one, that updates the database... if your new you probably dont have a database created... hopefully im wrong lol.. SIMPLE EXPLANATION..... <form method="post" action="LINK TO YOUR UPDATE FUNCTION GOES HERE"> NAME: <input type="text" size="15" maxlength="50" name="name"> <br /><br /> EMAIL: <input type="text" size="15" maxlength="20" name="EMAIL"><br /><br /> AGE: <input type="number" size="15" maxlength="20" name="AGE"> <br /><br /><input type="submit" value="Send"> </form> DATABASE SHOULD CONSIST OF USER TABLE WITH ... id name EMAIL AGE..... for your mail function to update... look around on here and see how a mod is made.... Edited June 3, 2011 by lucky3809 Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 all i want it to do as soon as they submit after they have type into the forms i get a instant email with the results i have tryed to look it up do i need to make the page that it takes u to after with any special code Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 3, 2011 Share Posted June 3, 2011 well going off that part you put on here, you probably copied and pasted from a source code... which must mean you havent learned the inside coding... Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 (edited) Well first off “action” does not take the email. http://www.w3schools.com/html5/html5_form_input_types.asp As that link shows (or should i never really checked it) HTML5 does not like all browsers. PHP or something like it is still the better way to go. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php $errors = array(); if (isset($_POST['submit'])) { // check name with preg match // email with filter_validate_email // age with is_numeric } if (empty($errors) && isset($_POST['submit'])) { // send email } else { // post errors } ?> <div class="common-padding clearfix"> <h4 class="secondary-dark">Welcome</h4> <form method="post" action=""> NAME: <input type="text" size="15" maxlength="50" name="name"> <br /><br /> EMAIL: <input type="text" size="15" maxlength="20" name="EMAIL"><br /><br /> AGE: <input type="number" size="15" maxlength="20" name="AGE"> <br /><br /><input type="submit" value="Send" name="submit"> </form> </body> </html> Using an array to store error see here - http://makewebgames.io/showthread.php/37890-Error-Checking-Storing-and-Showing Is_numeric - http://php.net/manual/en/function.is-numeric.php Filter the email - http://www.w3schools.com/php/filter_validate_email.asp Make sure there is some kind of check for bots (captcha), and something to ensure no one can send an email twice. Edited June 3, 2011 by Dominion Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 LINK TO YOUR UPDATE FUNCTION GOES HERE do i need to put any code in that page for the form and can i do it without a database Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 Thanks dom :d Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 3, 2011 Share Posted June 3, 2011 You need a database if your wanting their info to go to your email.... How is it going to read the commands if you have no database..it would send you a blank mail... Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 You need a database if your wanting their info to go to your email.... How is it going to read the commands if you have no database..it would send you a blank mail... you would get it from $_POST['']'s? why would you store it in the database then reselect it? Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 3, 2011 Share Posted June 3, 2011 (edited) Does he not need an action for that form? and does he not need that action to update something? For it to give him that info he wants sent to his email? Im so lost lol.. Maybe i read this thread wrong....I wasnt talking about a database for his form meant for his function to send that info to his email... Edited June 3, 2011 by lucky3809 Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 Does he not need an action for that form? and does he not need that action to update something? For it to give him that info he wants sent to his email? Im so lost lol.. Maybe i read this thread wrong....I wasnt talking about a database for his form meant for his function to send that info to his email... action="" means the same page. I am not sure why you are trying to put this into a function, but i guess you could be talking about game mail rather than Emails? Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 I put that in and it still didnt send the email? Quote Link to comment Share on other sites More sharing options...
Kieran-R Posted June 3, 2011 Share Posted June 3, 2011 http://php.net/manual/en/function.mail.php Look at the examples there. And as said before, don't come here expecting to demand code, then get it given to you. Give that a good read, then come back and ask for help if your still having trouble learning it. Explain what you don't understand of which you are trying to learn, then you will get the help you require. This way you learn something... Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 I put that in and it still didnt send the email? Post what you have? Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php $errors = array(); if (isset($_POST['submit'])) { // check name with preg match // email with filter_validate_email // age with is_numeric } if (empty($errors) && isset($_POST['submit'])) { // send email } else { // post errors } ?> <div class="common-padding clearfix"> <h4 class="secondary-dark">Welcome</h4> <form method="post" action=""> NAME: <input type="text" size="15" maxlength="50" name="name"> EMAIL: <input type="text" size="15" maxlength="20" name="EMAIL"> AGE: <input type="number" size="15" maxlength="20" name="AGE"> <input type="submit" value="Send" name="submit"> </form> </body> Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 Ah I see the main problem here. You see i gave an example of what should go were with comments... It's for you to make it work. The links I posted would help you. Quote Link to comment Share on other sites More sharing options...
morgan1122 Posted June 3, 2011 Author Share Posted June 3, 2011 what would the sql be to make the database?? Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 3, 2011 Share Posted June 3, 2011 what would the sql be to make the database?? Read the thread back over. Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 4, 2011 Share Posted June 4, 2011 This is unsecured... as for i have no time to add the special if statements... just did this for you to test it and get an idea... Dom is correct you do not need no database, i was thinking different... <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php $name=$_POST['name']; $email=$_POST['EMAIL']; $age=$_POST['AGE']; $message .="$name"; $message .= "\n"; $message .="$email"; $message .= "\n"; $message .="$age"; mail('[email protected]',$subject,$message); ?> <div class="common-padding clearfix"> <h4 class="secondary-dark">Welcome</h4> <form method="post" action=""> NAME: <input type="text" size="15" maxlength="50" name="name"> EMAIL: <input type="text" size="15" maxlength="50" name="EMAIL"> AGE: <input type="number" size="15" maxlength="20" name="AGE"> <input type="submit" value="Send" name="submit"> </form> </body> Quote Link to comment Share on other sites More sharing options...
Failbro Posted June 5, 2011 Share Posted June 5, 2011 Why even do this project if you cant code Quote Link to comment Share on other sites More sharing options...
Dominion Posted June 5, 2011 Share Posted June 5, 2011 Why even do this project if you cant code To learn? Many learn by doing a full project... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.