Click to See Complete Forum and Search --> : Problem with form


dusan
05-22-2007, 09:23 PM
Hellow, Im novice.
I did a web presentacion in frontpage but the server where is it is on Linux so my form doesnt work good because of missing ef extensions of frontpage.
Now I did a form with

<FORM METHOD="POST" ACTION="mailto:mymail">
&nbsp;<INPUT TYPE="text" NAME="nombre" SIZE="30">
<INPUT TYPE="text" NAME="telefono" SIZE="30">
&nbsp;<INPUT TYPE="text" NAME="correoelectronico" SIZE="30">

Where is mymail I put my email!

But when I want to send a form first I have a mesage in spanish but like the web page shows email and dont punt a code for a informations of the form.

Second I would like to send automaticly informations of a form to my mail.

I supose that I need some cgi or a code, so if somebody doesnt care for my Inglish and want to help, I wait.
Please gvi me detalled information what and where to do a things.
Thank you very much.
Dusan

ryanbutler
05-23-2007, 09:35 AM
Yes, you need a PHP script to collect, format and then the information to your email. In your action, specify a script such as formprocessor.php and add the following code:

<?php
//declare msg variable to help concatenate our message fields
$msg="Name: " . $_POST['name'] . "\n";
$msg.="Email Address: " .$_POST['email'] . "\n";
$msg.="Comments/Suggestions: " .$_POST['comments']. "\n";
//use an additional variable to allow recipient to reply directly from this email
$additionalheaders="From: " .$_POST['email'];
//use mail function to send the mail, using all of four parameters
mail("webmaster@domain.com", "Contact Us", $additionalheaders, $msg);
//re-direct visitors to a success page
header("Location:http://www.somedomain.com");
//kill the script from executing any more
exit();
?>

This is just a START. Make sure you add any additional validation that you may require.