PDA

View Full Version : New to Dreamweaver : Question about Forms


maximus350zx
06-10-2012, 11:31 PM
Hello DreamWeaver Users

I want to create a form in Dreamweaver that asks for the users Name, age, and weight and also has a submit button. When the user hits the submit button I want the output to be on the same page and May read like this

Helllo <Name>

You are <age> and you weight <weight>

I have spent the klast 3-days playing with javascript but wonder if there is an easier way to do this?

edbr
06-11-2012, 02:39 AM
you could use php, give the page a .php extension,set the form action to same page and method as post and echo like so

<?php
echo "Hello ". $_POST[' name' ]. "<br>";
echo "You are " . $_POST[' age' ];
echo "and you weigh ".$_POST[' weight' ];
?>
$_POST names must match the names of your form fields

davidj
06-15-2012, 01:06 PM
You will need a PHP environment for ed's example to work of course. Check out....

http://www.wampserver.com/en/

or

http://www.apachefriends.org/en/xampp.html