HELP: created dreamweaver form, but how do i get results from form?

Reply

Join Date: Nov 2005
Posts: 2
Reputation: maxtaz is an unknown quantity at this point 
Solved Threads: 0
maxtaz maxtaz is offline Offline
Newbie Poster

HELP: created dreamweaver form, but how do i get results from form?

 
0
  #1
Nov 8th, 2005
up to 3am last night, any help appreciated!!! have a html form created in dreamweaver. want users to complete their details on a form. do not need a dynamic page or sql d.base as only one way traffic. i just want to receive date in either email or excel format. my hoster works with cgi and php, but not asp. have read php is better, but do i need to creat a php script and do i create it in dreamweaver or do i create it thru the cpanel of my web hoster... really confused, know that i need to create this 'interpreter' prob using php, but don't know where its sits. could i cut and paste a php script and save as a .php in dreamweaver, if so how will this send the data, name-value pairs to my web hoster email or a specifiec excel d.base. wot do i type in my ACTION box!!!!! answers on a postcard please.......... thank u xxxxxxxx
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 9
Reputation: msteudel is an unknown quantity at this point 
Solved Threads: 0
msteudel msteudel is offline Offline
Newbie Poster

Re: HELP: created dreamweaver form, but how do i get results from form?

 
0
  #2
Nov 9th, 2005
This should be fairly easy for you to do. We'll use a two page method as that's pretty easy to do.

1. Point your form at your soon to be created php script. You should have some like below in your form, method and action are the important part right now.

e.g. [PHP]<form name="register" method="post" action="process.php">[/PHP]

2. Create a page called process.php

note: if you see something like <words> change everything including the brackets.

[PHP]<?php

// this sets up your email headers, just change the email address
$headers = "From: "<youremailaddress@yourdomain.com>\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";

// this emails you the results of the form
mail( "<youremail@yourdomain.com>", "<subject>", print_r( $_POST, true),"$headers">

// this will redriect the user somewhere away from this page
header("location: http://<whereyouwanttheusertobedirected>");

?>[/PHP]

So above it would print out something like:

  1. Array ( [name] => Mark [email] => mark@email.com [buttons] => Array ( [submit] => Submit ) )

Ugly but gets the job done. Once you get the above working you could try formating the message differently:
[PHP]
$message = "

Name: ".$_POST[name]."<br />
Email: ".$_POST[email]."<br />";

[/PHP]

Then you would replace the the print_r( $_POST ) with $message in your mail() command, like below
[PHP]mail( "<youremail@yourdomain.com>", "<subject>", $message ,"$headers">[/PHP]
Now it would print out like:

  1. Name: Mark
  2. Email: mark@email.com

You could get even more completed by adding html commands to format text, add tables, whatever your imagination comes up with.

Have fun!

Mark
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 9
Reputation: msteudel is an unknown quantity at this point 
Solved Threads: 0
msteudel msteudel is offline Offline
Newbie Poster

Re: HELP: created dreamweaver form, but how do i get results from form?

 
0
  #3
Nov 9th, 2005
I noticed the this forum stipped out my backslashes, so wherever you see "rn" in the headers area there needs to be a backslash, eg. \r\n
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 2
Reputation: maxtaz is an unknown quantity at this point 
Solved Threads: 0
maxtaz maxtaz is offline Offline
Newbie Poster

Re: HELP: created dreamweaver form, but how do i get results from form?

 
0
  #4
Nov 11th, 2005
gosh ur an angel..im going to try it right away... someone also mentioned executed php script so will explore too...thank u a million times... (big smiley face)
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 9
Reputation: msteudel is an unknown quantity at this point 
Solved Threads: 0
msteudel msteudel is offline Offline
Newbie Poster

Re: HELP: created dreamweaver form, but how do i get results from form?

 
0
  #5
Nov 11th, 2005
Originally Posted by maxtaz
gosh ur an angel..im going to try it right away... someone also mentioned executed php script so will explore too...thank u a million times... (big smiley face)
NP ask if you have questions.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 1
Reputation: vgnarc@freshrus is an unknown quantity at this point 
Solved Threads: 0
vgnarc@freshrus vgnarc@freshrus is offline Offline
Newbie Poster

Re: HELP: created dreamweaver form, but how do i get results from form?

 
0
  #6
Oct 21st, 2006
i tried to use this scrpit and i resulted in error.please i would like to kno any correction that can be made in my code. the form page is www.freshrus.com/form.html
then i tried to make the
www.freshrus.com/process.php

if u can read the code and help me out it would be greatly spprcisted
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC