Foo - setting up a form in dreamweaver

Bikeforums.net is a forum about nothing but bikes. Our community can help you find information about hard-to-find and localized information like bicycle tours, specialties like where in your area to have your recumbent bike serviced, or what are the best bicycle tires and seats for the activities you use your bike for.




View Full Version : setting up a form in dreamweaver


phantomcow2
02-22-05, 06:57 PM
How i set up a form in dreamweaver? I have all of the text boxes i want, but its the submit i cant get. I want people to be able to click submit and have the information sent right to my email. Please help


Maelstrom
02-22-05, 06:59 PM
What server sided scripting language are you using to process the info?

phantomcow2
02-22-05, 07:14 PM
holy crap that confused me so much i dont think im going to bother with a form.


Maelstrom
02-22-05, 07:35 PM
Dreamweaver (last time I used it) makes the front end. The form won't do diddly if you don't have some sort of script to process the form into an email :)

phantomcow2
02-22-05, 07:45 PM
Im pretty tech savvy with a computer (built many on my own) but for some reason the internet HTML scrips and stuff of the like looses me.

Maelstrom
02-22-05, 08:16 PM
What you are doing is pretty simple. It would be a very short php backend script. www.sitepoint.com will have a tutorial on building a script to process forms. Try www.w3schools.com too.

way124
02-22-05, 08:20 PM
I think you mean this http://www.mcli.dist.maricopa.edu/tut/tut28b.html Basically this bit:

<form method="post" action="mailto:me@myemail.bigu.edu">

This only works only when the user has something like Outlook. Of course this doesn't quite make sense to use because

1. Not everyone uses Outlook kind of program to email.
2. Not many want to expose their email to you.
3. You think you hid your email from spammers. Nope.
4. The result isn't quite readable.

So yeah, you're better off having a server-side script to process the data for you. Which will be another topic if you don't know any of them...

phantomcow2
02-22-05, 08:28 PM
well its not really a matter of hiding my email from spammers. I just think it looks more professional. PHP and scripts lose me, i think i might bribe a friend into doing it

Maelstrom
02-22-05, 09:13 PM
Thats a rough way of doing it as you don't control the output. (its pretty raw, I haven't used that method in ages)

If your form is only 5 or 6 entries in reality this script can be written in a few minutes by a reasonable scripter. (basically 1 or 2 beers ;))

phantomcow2
02-22-05, 09:18 PM
actually its only 4 entries. So that would not be overly difficult to achieve then?

Maelstrom
02-22-05, 09:31 PM
No its really simple. You would create a "action" to a small php file (hoping the server has php). The php file would rewrite the transmitted data into whatever format you want and then use the mail function to mail you. With 4 entries and you having done the front page it should take him 10 minutes to write (not even enough time to finish a beer)

If the server doesn't have php you need to find out what scripting language you can use.

Maelstrom
02-22-05, 09:39 PM
[script]
<?php
//
//using GET method because I like to have urls to copy blah blah
//GET is how an html form transmits data (or POST)
//
$message="
<table>
<tr>
<td>Name</td>
<td>".$_GET["name"]."</td>
</tr>
<tr>
<td>age</td>
<td>".$_GET["age"]."</td>
</tr>
<tr>
<td>Hobby</td>
<td>".$_GET["hobby"]."</td>
</tr>
<tr>
<td>Gender</td>
<td>".$_GET["gender"]."</td>
</tr>
</table>
";

$to = 'your addy goes here';
$subject = 'place subject here';
$headers = 'From:bob@home.com"\r\n" .
'Reply-To:bob@home.com\r\n" .
'X-Mailer: PHP/' . phpversion();

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

Keep in mind there is no data checking and this will email anything and everything inputted. I also didn't put in any fault checks. I just don't have the energy to bother. (heck I don't even know if the code will show up when vbulleting strips it)

All I did was move over the 'show' html into a variable and use that variable to email to whoever you want. Quick and dirty but something like it would do what you want.

jfmckenna
02-23-05, 09:27 AM
You might want to make sure you can even use php first.

phantomcow2
02-23-05, 04:05 PM
lol php looses me. Im gonna get my friend a starbucks and have him do it