Tutorial Needed: Inserting Forms

They have: 12 posts

Joined: Oct 2003

I'm running DW4 and I'd line to insert a response form. That is, I want to ask spacific questions, have either multiple choice box answers or room for descriptive answers. Then, I would like to have a button that would send it to me via the visitors email account.

Is there some good "freeware" or reasonable priced software that can automate these tasks? Or, does anyone know of a goot tutorial that I could use?

Thanks for any help you can offer!

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

They have: 461 posts

Joined: Jul 2003

nope. however, mailtos don't work in forms, or wont be working in forms....so are you using asp or php?

i can help you set up a self processing form in php if you'd like, and then it shouldn't be hard for you to adjust it int he future if you keep good comments

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

They have: 12 posts

Joined: Oct 2003

m3rajk wrote: nope. however, mailtos don't work in forms, or wont be working in forms....so are you using asp or php?

i can help you set up a self processing form in php if you'd like, and then it shouldn't be hard for you to adjust it int he future if you keep good comments

I hate to act like the "village idiot", but, I don't know much about asp or php? However, where I have my hosting account, they do say that php can be used.

I'm not sure which of the following sayings apply to me:

There no such thing as a stupid question.

or

It's better to be thought of as an idiot than open one's mouth and remove all doubt.

Hmmm....

Yeah, I can use all the assistance you can offer.

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Mailto does still work in forms? It's just not a good idea. Smiling

***

For php, you need to have a processor on the server that you send the form information to:

and in "mailme.php", you'd do this:

<?php
// fields from form are 'msg, eddress'
$message = $_POST['msg'];
$email = $_POST['eddress']; // heh, ain't I clever?

// this is stuff you can set (or be fields in your form)
$myeddress = \"[email protected]\";
$subject = \"this is a form sent from my domain to me!\";

// send the form contents on their way!
mailto(
$myeddress,$subject,$message,\"From: $email\");

// send the user to a nice static thank you page
header(\"Location: http://www.mydomain.com/thanks.html\");
exit;
?>

Note: This HAS security holes and NO DATA VERIFICATION and I typed it off the top of my head so it may well have typos as well, so use AT YOUR OWN RISK.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

I created a generic PHP formmailer a while ago, it might be of some use to you, just add this to your form tag:

action="http://www.sitebug.com/public/mail.php"

e.g.

...your form stuff...

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

hey, Renegade -- how would he get the email without saying where it is to go?? Wink

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

lol heres a sample of a minimum:
http://chengeu.krayup.com/public/mail_testing.html

...just view source...sorry, my fault :S

They have: 12 posts

Joined: Oct 2003

Renegade wrote: lol heres a sample of a minimum:
http://chengeu.krayup.com/public/mail_testing.html

...just view source...sorry, my fault :S

The form is a good basis for what I need. However, I don't see the code that would envoke the users email platform.

Also, I was expecting to see some kind of "mailto:[email protected]" or something like that.

Am I missing something?

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

yes -- the action in Renegade's example calls his script and the hidden field tells his script where to email the information.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

<form method="post" action="http://chengeu.krayup.com/public/mail.php">
      <input type="hidden" name="form_to" value="YOUR EMAIL ADDRESS GOES HERE" />
      <p>Name: <input type="text" name="form_from" value="Name" /></p>
      <p>Email: <input type="text" name="form_email" value="Email" /></p>
      <p>Subject: <input type="text" name="form_subject" value="Subject" /></p>
      <p>Message: <textarea name="form_message">Message</textarea></p>
      <p><input type="reset" value="Reset" /> <input type="submit" value="Submit" /></p>
    </form>
'

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

The main drawback of this option is that your email address WILL get harvested by spam spiders.

They have: 12 posts

Joined: Oct 2003

Suzanne wrote: The main drawback of this option is that your email address WILL get harvested by spam spiders.

Which brings up two more questions. What would I put in this part:

And, is there a way to get around the spam spiders?

Bob

Remember: If you keep doing what you're doing, you'll keep getting what you're getting!

Busy's picture

He has: 6,151 posts

Joined: May 2001

The only way to avoid the email spiders is to use server side (PHP, ASP etc).
Use Suzannes example above (post #4) and they can't get your email address.

With PHP, just because it's in the code, doesn't mean it's on the page or is viewable. Just make a form, use the name= on the inputs, calling them 'msg' and 'eddress' and should all work good. Just remember to name the page with a .php extension.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.