shrine Posted November 28, 2009 Share Posted November 28, 2009 I made a form using this, and it generated a really nice html form.. Unfortunately, it didn't make a php file to go along with it. I'm doing my best to understand this, but I'm having a lot of trouble locating the variables and text that I should actually be editing. Has anyone ever worked with phpforms.org before to send the form to email? Quote Link to comment https://forums.phpfreaks.com/topic/183186-phpformorg/ Share on other sites More sharing options...
Jnerocorp Posted November 28, 2009 Share Posted November 28, 2009 can u post the form code? -John Quote Link to comment https://forums.phpfreaks.com/topic/183186-phpformorg/#findComment-966778 Share on other sites More sharing options...
oni-kun Posted November 28, 2009 Share Posted November 28, 2009 I made a form using this, and it generated a really nice html form.. Unfortunately, it didn't make a php file to go along with it. I'm doing my best to understand this, but I'm having a lot of trouble locating the variables and text that I should actually be editing. Has anyone ever worked with phpforms.org before to send the form to email? It does what it says! PHP requires input, and those HTML forms give the text. Lets say in the <input method=post name="lastname">, had name="lastname". This would mean the following PHP code can access it: $last_name = $_POST['lastname']; echo $last_name; But if you were to use it on the same page, you'd write: (HTML form above php code..) <?php if (isset($_POST['lastname'])){ $last_name = $_POST['lastname']; echo $last_name; } else { echo "Warning, You haven't entered a last name!"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/183186-phpformorg/#findComment-966955 Share on other sites More sharing options...
shrine Posted November 28, 2009 Author Share Posted November 28, 2009 Okay, I see. I was a bit confused by what it was actually doing for me. Thanks very much for your help. I attached the form html I made with it. It makes a really neat form, but of course they ask you to pay for the php... <form id="form_145479" class="appnitro" method="post" action="emailthisstuff.php"> <input id="fname" name= "fname" class="element text" value=""/><label>First</label> ... emailthisstuff.php: <?php if(isset($_POST['submit'])) { $to = "you@you.com"; $subject = "Form info"; $fname_field = $_POST['fname']; $lname_field = $_POST['lname']; $body = "From: $fname_field $lname_field\n"; echo "Data has been submitted to $to!"; mail($to, $subject, $body); } else { echo "Your message was not sent."; } ?> Will this pretty much send that data to the email? Will the echo be shown to the visitor? I appreciate any more input! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/183186-phpformorg/#findComment-967083 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.