PDA

View Full Version : Form Retrieval


Wahoo
08-27-2009, 02:35 PM
Hello everyone,

I am very new to the forms features in Dreamweaver.

I set up a basic form for visitors to email (Name, email, comments then submit button). My question is what values do I put in the "Action" field and what "Method" choice (Default, POST, or GET) is used to retrieve the info the visitors enter in the blanks?

I watched the Lynda.com Dreamweaver video and the guy stops short of telling you what to put in the fields stating that you should contact your web host. So I did that and they were zero help.

This seems like a basic fix. Hopefully someone can help.

Thank you.

edbr
08-28-2009, 01:52 AM
the usual method is Post.
as for action , this must point to a page , typically it will point to a page where your details should go. i suspect you want to email these details. if so you need a mailing script for example using php which will process / send an email.
you will find one on this forum in tutorials or there are many available yahoogling will find them

Wahoo
08-28-2009, 03:59 PM
Thanks for your response.

I am about to give up on this though. I searched and found many form scripts, altered them to reflect what I have on the site but all it does when the submit button is clicked is show the PHP page.

I really just want the basic in form function. Name, email & comments sent to my email and then have my "successful.html" page shown. At this point I don't care about validation I'd just like it to work. It's frustrating as it seemed simple to do at the time.

edbr
08-31-2009, 02:30 AM
it is simple. just to be clear the action page has a mailing script in it?
as far as going to a different page it needs a simple redirect statement to act when the mail is processed.
if you post your mail script we can maybe help you

Wahoo
08-31-2009, 03:08 AM
Hi thanks for the reply and the help,

Yes, I really thought this would be easier. I plan on just redoing the form in Dreamweaver. Here is the php form I was trying to use and it is placed in the action field:

<?php
$Name = $_REQUEST['Name'] ;
$Email Address = $_REQUEST['Email Address'] ;
$Comments = $_REQUEST['Comments'] ;

mail( "my_email@aol.com", "Comment Form Results",
$message, "From: $Email Address" );
header( "Location: http://www.success_contact.html" );
?>

I am currently getting this error when I click the submit button:

Parse error: syntax error, unexpected T_STRING in /home/chris259/public_html/sendmail.php on line 3

So I am going to redo the form and if I am doing anything wrong here please advise.

Much appreciated.

edbr
08-31-2009, 03:17 AM
try this. i changed $ Request as im not a fan but you can use it if you want

<?php
$subject = "Comment Form Results" ;
$mail="my_email@aol.com";
$Name = $_POST['Name'] ;
$Email = $_POST['Email Address'] ;
$Comments = $_POST['Comments'] ;
$message= "From:". $Email ."Address" \n
$Comments;


mail($mail= , $subject,
$message, );
header( "Location: http://www.success_contact.html (http://www.success_contact.html/)" );
?>

Wahoo
08-31-2009, 03:21 AM
Thanks, I will try this tomorrow and post if it works.

Finland Blue
08-31-2009, 06:22 AM
Is it possible to get the results in aan email AND display the results on the web page?

edbr
08-31-2009, 07:07 AM
yes if using php you can do this for example
<?php
$subject = "Comment Form Results" ;
$mail="my_email@aol.com";
$Name = $_POST['Name'] ;
$Email = $_POST['Email Address'] ;
$Comments = $_POST['Comments'] ;
$message= "From:". $Email ."Address" \n
$Comments;


echo $Name. "<br>".$Comments;

mail($mail= , $subject,
$message, );
header( "Location: http://www.success_contact.html (http://www.success_contact.html/)" );
?>

Wahoo
08-31-2009, 02:42 PM
Tried the new form and now I get:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/chris259/public_html/sendmail.php on line 7

Parse error: syntax error, unexpected T_STRING in /home/chris259/public_html/sendmail.php on line 7

Any ideas?
I will try to redo the form itself in Dreamweaver perhaps I bugged something up in the process.Thanks