Jump to content
MakeWebGames

Recommended Posts

Posted

<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

Guest LostOne
Posted

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 :)

Posted (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 by lucky3809
Posted

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

Posted (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 by Dominion
Posted
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?

Posted (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 by lucky3809
Posted
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?

Posted

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...

Posted

<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>

Posted

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>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...