I have 1 field for the user to fill it then when they click Submit it sends that 1 piece of information to my email.
How can I do this?

I have 1 field for the user to fill it then when they click Submit it sends that 1 piece of information to my email.
How can I do this?
PHP Code:<?php
$to = "[email protected]"; // The email address to send the message to.
$body ="Message here " . $_POST['textboxname']; //The body of our message. Separate lines with "\n".
$body =wordwrap($body,70); // 70 Chars per line
$subject = "Hello"; //The subject of our message.
mail($to, $subject, $body); //Send the message
?>
Last edited by triston220; 12-11-2011 at 08:27 PM.
I need to email the information they put in the textbox to me.PHP Code:<?php
$to = "example[@]@expample.com"[/@]; // The email address to send the message to.
$body ="Message here " . $_POST['textboxname']; //The body of our message. Separate lines with "\n".
$body =wordwrap($body,70); // 70 Chars per line
$subject = "Hello"; //The subject of our message.
mail($to, $subject, $body); //Send the message
?>
this is my html form thingy:
and i need to sent the information given in that name field to my email.HTML Code:<html> <br /><br /><br /> <center> <form action="send.php" method="POST"> name: <input type="text" name="name" /><br /> <i>(Case sensitive)</i><br /> <input type="submit" value="Submit" /> </form> </center> </html>
Last edited by Thomas; 12-11-2011 at 09:09 PM.
What's the name of the textbox.I need to email the information they put in the textbox to me.
this is my html form thingy:
and i need to sent the information given in that name field to my email.HTML Code:<html> <br /><br /><br /><center><form action="send.php" method="POST">name: <input type="text" name="name" /><br /><i>(Case sensitive)</i><br /><input type="submit" value="Submit" /></form></center></html>
It does say in that html code i posted...? or i am being stupid?
<html> <br /><br /><br /> <center> <form action="send.php" method="POST"> name: <input type="text" name="name" /><br /> <i>(Case sensitive)</i><br /> <input type="submit" value="Submit" /> </form> </center> </html>
PHP Code:<?php
$to="[email protected]";//Theemailaddresstosendthemessageto.
$body=$_POST['name'];//Thebodyofourmessage.Separatelineswith"\n".
$body=wordwrap($body,70);//70Charsperline
$subject="Hello";//Thesubjectofourmessage.
mail($to,$subject,$body);//Sendthemessage
?>
It sends (it think) but i do not get any emailPHP Code:<?php
$to="example[@]@expample.com"[/@];//Theemailaddresstosendthemessageto.
$body=$_POST['name'];//Thebodyofourmessage.Separatelineswith"\n".
$body=wordwrap($body,70);//70Charsperline
$subject="Hello";//Thesubjectofourmessage.
mail($to,$subject,$body);//Sendthemessage
?>
try it: www.supersurvival.net/join
Last edited by Thomas; 12-11-2011 at 10:30 PM.
still not working, anyone?
Excuse my how bad i am at html and phpHTML Code:<html> <br /><br /><br /> <center> <form method="POST"> Minecraft name: <input type="text" name="name" /><br /> <i>(Case sensitive)</i><br /> <input type="submit" value="Submit" /> </form> </center> <?php mail('t.*******[@]@*****.co.uk', 'SuperSurvival', $_POST["name"][/@];); ?> </html>![]()
Make a separate page for your php code (e.g. mail.php).
Then link to it with your form, examplePHP Code:<form action='mail.php' method='POST'>
Want to hide these adverts? Register an account for free!