English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm currently designing a site that makes use of an online poll. The poll has radio buttons for each of the choices, with the last one being a text box ("other"). Does anyone have any PHP code I could use in order to send the results to a specific email address? It would probably have a lot of "if/then" statements, but CANNOT make use of databases.

Here's what the form looks like (it's the poll on the lower right):
http://gid.cdiabu.com:16080/ftfall06a/Potenco/contact.html

2007-05-03 04:40:48 · 4 answers · asked by Daniel 2 in Computers & Internet Programming & Design

4 answers

form action should be something like send_poll_results.php

and send poll results.php would be as follows:


if (isset($_POST['submit'] && $_POST['submit'] == "  SUBMIT  ") {

mail("toaddress","subject",$_POST['radio1']);

?>

May need to make the mail script a bit more secure but thats the just of it.

2007-05-03 09:53:28 · answer #1 · answered by rob 3 · 0 0

PHP will not make the data load unless you reload the page. This would require the use of a submit button to pass the selected item back to the page. You will need Javascript to make it automatic.

2016-05-19 21:09:20 · answer #2 · answered by ? 3 · 0 0

PHP Has a mail function built in.

mail(to, subject, message, headers);

Normally, you want to put all of those in to variables.

$to = 'name@whatever.com';
$subject = 'Website Poll';
$headers = 'From: Blah Blah ';

$message = 'Whatever message';

mail($to, $subject, $message, $headers);
?>

Check out http://www.php.net

2007-05-03 09:05:39 · answer #3 · answered by mistirydragon 2 · 0 0

www.jotform.com

or

formmail.php available at http://www.dtheatre.com/scripts/

2007-05-03 04:48:25 · answer #4 · answered by fjpoblam 7 · 0 0

fedest.com, questions and answers