PDA

View Full Version : submission forms


brisa_main
01-27-2006, 01:39 PM
hey
i need to have a submission form that has

title

surname

initial

address

telephone

comments

and a submit button to an email address

how do i do this? i cant find any tutorials

cheers

desertdirk
01-27-2006, 03:01 PM
try this
http://www.apptools.com/phptools/forms/

how to do a mail form in DW
dd

brisa_main
01-30-2006, 02:19 PM
woow that didnt make any sense really, surely theres some templates where i can just input the email addy where i want the info to be sent to?

TheBaldOne
01-30-2006, 02:30 PM
Dont know if this will help you but I needed a something similar and I went on a javascript website and found one very close and with a bit of playying around I got what I wanted.

I got mine from here. www.javascriptkit.com/

cheers
TheBaldOne

desertdirk
01-30-2006, 03:11 PM
brisa_main
I can upload a generic php email form if that is what you need.
dd

brisa_main
01-30-2006, 06:20 PM
a mate sent me this code to edit:

<form action="http://www.fourfourtwo.net/myscript/formmail.cgi" method="post">
<input type=hidden name="subject" value="Feedback Form">
<input type=hidden name="recipient" value="my@mine.net">
<input type=hidden name="redirect" value="http://www.fourfourtwo.net/myscript/done.html">

i understand where to input the relevant email and that the redirect value will be a conformation page but whats the 'form action' address meant to be?

domedia
01-30-2006, 06:56 PM
'Form action' is what the form is supposed to do when you click submit. In the snippet your friend sent you the form is supposed to be processed by a CGI script that actually generates/sends out the email. HTML cannot generate email so you need to rely on cgi/php/asp.. your flavor..
If your host supports PHP I would take Dirk up on his offer :)

brisa_main
01-31-2006, 09:16 AM
brisa_main
I can upload a generic php email form if that is what you need.
dd

how do i find out if my host supports php?
also it would be amazing if you could upload a generic one :!:

cheers

Creative Insanity
01-31-2006, 09:21 AM
To find out if your hoster supports php (if not obvious in the control panel)
Create a text file called info.php and in that file add:
<? phpinfo(); ?>
and upload to your www or public_html directory and then call that file from a browser.
If you see a heap of info on a blue background about php and mysql then your hoster supports php.
If you only see <? phpinfo(); ?> then no your hoster does not.

brisa_main
01-31-2006, 09:38 AM
ok pretty sure my host doesnt support php.

is the cgi bit hard?

man i thought this would be a hell of a lot easier to get a submission form!

cheers for your help

davidj
01-31-2006, 11:27 AM
man i thought this would be a hell of a lot easier to get a submission form!


welcome to world of madness

hahahahahahahahahahahahahah hahahaha
hahahahaha hahahahaha hahahahahah hahaha ......twitch twitch

desertdirk
01-31-2006, 02:39 PM
well I posted a reply with the code but don't know where it went
dd

domedia
01-31-2006, 02:44 PM
Just post it again, and make sure you put code tags around it this time ;)

desertdirk
01-31-2006, 05:00 PM
Just post it again, and make sure you put code tags around it this time
Sorry I could have sworn I did. But here it is:


<HTML>
<HEAD>
<TITLE>Email Form</TITLE>
</HEAD>
<BODY>

<?
$form_block ="
<FORM METHOD=\"POST\" ACTION=\"$_SERVER[PHP_SELF]\">

//<P align=center>PUT TITLE HERE</FONT></P>



Your Name:

<INPUT type=\"text\" NAME=\"sender_name\" VALUE=\"$_POST[sender_name]\" SIZE=30></P>



Your E-Mail Address:

<INPUT type=\"text\" NAME=\"sender_email\" VALUE=\"$_POST[sender_email]\" SIZE=30></P>



Message:

<TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$_POST[message]</TEXTAREA></P>

<INPUT type=\"hidden\" name=\"op\" value=\"ds\">



<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Send This Form\"></p>
</FORM>";


if ($_POST[op] != "ds") {

//they need to see the form
echo "$form_block";

} else if ($_POST[op] == "ds") {

//check value of $_POST[sender_name]
if ($_POST[sender_name] == "") {
$name_err ="<font color=red>Please enter your name!</font>
";
$send ="no";
}

//check value of $_POST[sender_email]
if ($_POST[sender_email] == "") {
$email_err ="<font color=red>Please enter your e-mail address!</font>
";
$send ="no";
}

//check value of $_POST[message]
if ($_POST[message] == "") {
$message_err ="<font color=red>Please enter a message!</font>
";
$send ="no";
}

if ($send != "no"){
//it's ok to send,so build the mail
$msg ="E-MAIL SENT FROM Your Web Site \n";
$msg .="Sender's Name:$_POST[sender_name]\n";
$msg .="Sender's E-Mail:$_POST[sender_email]\n";
$msg .="Message:$_POST[message]\n \n";

$to ="name@domain.com"; ////////////////////////////put email address here
$subject ="Message from Your Web Site"; ////what is contained in the quotes is what the message will be
$mailheaders ="From:Web Site <>\n";/////////////////////////put where the mail is coming from ie my web site
$mailheaders .="Reply-To:$_POST[sender_email]\n\n"; ////// the reply to is the email of the sender

//send the mail
mail($to,$subject,$msg,$mailheaders);

//display confirmation to user
echo "

Mail has been sent!</p>";

} else if ($send =="no"){
//print error messages
echo "$name_err";
echo "$email_err";
echo "$message_err";
echo "$form_block";
}
}
?>

</body>
</html>


This mail form has 3 text fields which are all required. If one of them is not filled in when the button is clicked, the form returns with errors of what was not filled in.
Modify as nesc.
Obviously for PHP
dd