Hi struggling to get a feedback form working - unsure of the code for the submit button. Just want feedback to come to my email. Can anyone help![]()
Hi struggling to get a feedback form working - unsure of the code for the submit button. Just want feedback to come to my email. Can anyone help![]()
Last edited by Gouri; 02-08-2011 at 06:41 PM.
If you feel my post is useful then clickto give Reputation (bottom left corner of this post)
X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership
Tech Community | Gouri
<form action="http://yoursite.com/url/to/php/file.php"> <-- that will send it to a PHP file.
Then, in the PHP file:
<?php
if(isset($_POST['submit'])){
//code here
}else{
die("Looks like an error occured :O");
}
?>
█ x10 Lieutenant
█ If I have helped, please click the star in the bottom left of my post.
█ Free Hosting support volunteer 410 posts from Community Advocate (This is NOT live!)
FROZENMAFIA! NO! XD
A - use the [php] tag
B - forms should have a method (in this example, post)
C - use $_SERVER['REQUEST_METHOD'] instead of isset($_POST..
D - why do you insist on not using spacing
~CallumPHP Code:<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$email = 'Email sent using feedback form on yoursite.' . "\n\n" . 'Name: ' . $_POST['name']; //etc...
$youremail = 'email@example.com';
mail($youremail, 'Feedback (subject)', $email, 'From: ' . $youremail);
}
else
{
?>
<form action="file.php" method="post">
<!-- inputs here -->
</form>
<?php
}
Last edited by callumacrae; 02-18-2011 at 03:49 PM.
I can customise your phpBB board. Send me a PM.
lynxphp - info, tutorials and scripts
"A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."