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

I have a very simple form designed that includes 4 fields to fill out for a user: First Name, Last Name, Email, and Phone Number. Now, when a user clicks on the submit button at the bottom I would like to take that step further whereby the fields data will be sent to a very simple database that creates a brand new record of that user. A few moments later a confirmation email will be sent to that particular user that will thank them for submitting the form and I hope to contact them again later.

Personally, I'm not a programmer I understand HTML and Dreamweaver and Photoshop and Illustrator and fireworks and flash but only to design web pages.

Please tell me how to accomplish this simple thing.

2006-11-02 06:35:34 · 4 answers · asked by razjains 1 in Computers & Internet Programming & Design

4 answers

You need some server side technology like ASP, ColdFusion, PHP, JSP, ...etc. in order to do what you want to do. Just HTML cannot do what you want to do.

I am a web developer by trade. If you have further questions, please feel free to contact me.

2006-11-02 07:53:07 · answer #1 · answered by knitting guy 6 · 3 0

Not sure if this is homework or what, so I'll give you a run down.
You appear to have a good handle on the problem which is the first step. Break what you need to do into step or actions i.e.
1, Get the user entered data from the fields
2. Add that data to the database.
3. Send Email.

Step one should be fairly simple, depending on how you approach it and what languages your using. Examples of how to do step 2 should be included with your data base package. Examples for step 3 can be found by searching the web.

2006-11-02 14:42:27 · answer #2 · answered by Pirate AM™ 7 · 0 0

ok, very simple task, some time consuming.

i would say create the script as php.

we'll call it "register.php"
//// the following was made

--------------------
if($_GET['step'] == "1"){

//this will be a simple form with: Name - first, last, email, phone

echo"

First Name
Last Name
Phone Number (10 digits)
Email

";

}

if($_GET['step'] == "2"){

//connect to database, host type goes in localhost. generally host type is localhost, if unsure leave alone.
//username is the database login username, sometimes may include prefix
//password is the database login password
//database is the database name, may include prefix

$connection = mysql_connect(localhost, username, password)
or die(mysql_error());
$db = mysql_select_db(database, $connection)
or die(mysql_error());

//database table: called 'table' and is the name of your database table
//please label the fields, they have been labeled automatically for a demo taste

$query = "INSERT INTO table (firstname,lastname,phone,email)
VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[phone]','$_POST[email]')";
$resultB = mysql_query($query,$connection) or die ("Coundn't execute query.");


$to = "$_POST[email]";
$subject = "my message here";
$headers = "From: my website name";
$msg = "Thank you for signing up with us $_POST[firstname] $_POST[lastname]!

Visit us soon again! at ourwebsite.com";
mail($to, $subject, $msg, $headers);
}
?>
--------------------

Ok how it works is that the form is set as a parameter of register.php, its parameter is called: step=1, with the attachment of ?, so the full url will be: register.php?step=1

Now this has form details, and only form details. When pressed submit, the form details gets sent to register.php?step=2, of course you can add if then statements to test if everything is completed, and done accurately.

Now in the step=2 parameter we have the database connections and the mailing daemon. follow the comments on the script to change the database details, and connection type.

$query can also be modified to what your fields are called, and the table their in. please try to stick with the order it is in, so dont move firstname to the end, and email to the front. and dont change the values.

below this we have the mailer.
subject can be edited and headers (the brackets and everything in it.
also the message can be edited.

whenever taking variables from a form use the following code: $_POST[fieldName]

change the fieldName to whatever your field is called.


best luck, more information contact alco19357@yahoo.com

alex

2006-11-02 15:29:38 · answer #3 · answered by alco19357 5 · 0 0

.
Is this code what you want? click link below:
http://rds.yahoo.com/_ylt=A0oGkkScSkpFAWwBUmNXNyoA;_ylu=X3oDMTE4cGwzcHZxBGNvbG8DdwRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZANZUzEwNl8xMjM-/SIG=12sbne1qr/EXP=1162583068/**http%3a//forums.devshed.com/asp-programming-51/automatic-email-212293.html

2006-11-02 14:47:24 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers