HighDots Forums  

Email forms in PHP (long) Need help

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Email forms in PHP (long) Need help in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob Boisvert
 
Posts: n/a

Default Email forms in PHP (long) Need help - 07-01-2004 , 09:18 PM






Hi All,

I need Help! In more ways than one but lets stick with PHP coding for now.
By the way, I know nothing about PHP but have to use it because that's what
the clients host supports.

I have simple form I have created and am using PHP to process the
information, all information is being passed but I having a hang up and I
can't find out what's causing it. The hang up is that when the information
is being received after being submitted through the web site, all field
information in the received email is one field above where it should be, and
I'n getting an extra name field in the email. An example is below: The form
is here http://www.ccrmed.com/Testing/catalog_request.html

Name: Office (this should not be here, office should be on the facility.)

Facility: first name

FirstName: last name

LastName: title

Title: dept

Dept: address

Address: phone

Phone: fax

Fax: email

Email: comments

Comments

This is what's handling the processing: The referring URL for the PHP code I
have is here http://www.webreference.com/programming/php/phpemail/ of course
I modified it to include the other fields that I have.

{
$message = "Name: $Facility\nFacility: $FirstName\nFirstName:
$LastName\nLastName: $Title\nTitle: $Dept\nDept: $Address\nAddress:
$Phone\nPhone: $Fax\nFax: $Email\nEmail: $Comments\nComments";
$extra = "From: $FirstName\r\nReply-To: $Email\r\n";
mail ("email (AT) email (DOT) com", "Catalog Request", $message, $extra);
echo "<p class=bodymd>Thanks for your inquiry, $FirstName.</p>";
echo "<p class=bodymd>We'll respond to $Email as soon as possible.</p>";
}

Can anyone shed some light on this and tell me why the email is processing
the way it is. If you need the rest of the code, please email me off list as
it is a little to much for posting.



Thanks,

Bob





Reply With Quote
  #2  
Old   
Jasper Allibang Espejo
 
Posts: n/a

Default Re: Email forms in PHP (long) Need help - 07-01-2004 , 09:56 PM






Take a look at your code. You placed all your variables in the wrong
places!!! Name contains the value of $Facility, Facility contains the value
of $Firstname, etc...

$message = "

Name: $Facility \n
Facility: $FirstName \n
FirstName: $LastName \n
LastName: $Title \n
Title: $Dept \n
Dept: $Address \n
Address: $Phone \n
Phone: $Fax \n
Fax: $Email \n
Email: $Comments \n
Comments
";

--
Jasper Allibang Espejo
:: www.juantamad.com ::




"Bob Boisvert" <webdad (AT) tampabay (DOT) rr.com> wrote

Quote:
Hi All,

I need Help! In more ways than one but lets stick with PHP coding for now.
By the way, I know nothing about PHP but have to use it because that's
what
the clients host supports.

I have simple form I have created and am using PHP to process the
information, all information is being passed but I having a hang up and I
can't find out what's causing it. The hang up is that when the information
is being received after being submitted through the web site, all field
information in the received email is one field above where it should be,
and
I'n getting an extra name field in the email. An example is below: The
form
is here http://www.ccrmed.com/Testing/catalog_request.html

Name: Office (this should not be here, office should be on the facility.)

Facility: first name

FirstName: last name

LastName: title

Title: dept

Dept: address

Address: phone

Phone: fax

Fax: email

Email: comments

Comments

This is what's handling the processing: The referring URL for the PHP code
I
have is here http://www.webreference.com/programming/php/phpemail/ of
course
I modified it to include the other fields that I have.

{
$message = "Name: $Facility\nFacility: $FirstName\nFirstName:
$LastName\nLastName: $Title\nTitle: $Dept\nDept: $Address\nAddress:
$Phone\nPhone: $Fax\nFax: $Email\nEmail: $Comments\nComments";
$extra = "From: $FirstName\r\nReply-To: $Email\r\n";
mail ("email (AT) email (DOT) com", "Catalog Request", $message, $extra);
echo "<p class=bodymd>Thanks for your inquiry, $FirstName.</p>";
echo "<p class=bodymd>We'll respond to $Email as soon as possible.</p>";
}

Can anyone shed some light on this and tell me why the email is processing
the way it is. If you need the rest of the code, please email me off list
as
it is a little to much for posting.



Thanks,

Bob







Reply With Quote
  #3  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: Email forms in PHP (long) Need help - 07-01-2004 , 10:00 PM



On 01 Jul 2004 in macromedia.dreamweaver, Bob Boisvert wrote:

Quote:
{
$message = "Name: $Facility\nFacility: $FirstName\nFirstName:
$LastName\nLastName: $Title\nTitle: $Dept\nDept: $Address\nAddress:
$Phone\nPhone: $Fax\nFax: $Email\nEmail: $Comments\nComments";
$extra = "From: $FirstName\r\nReply-To: $Email\r\n";
mail ("email (AT) email (DOT) com", "Catalog Request", $message, $extra);
echo "<p class=bodymd>Thanks for your inquiry, $FirstName.</p>";
echo "<p class=bodymd>We'll respond to $Email as soon as
possible.</p>";
}

Can anyone shed some light on this and tell me why the email is
processing the way it is. If you need the rest of the code, please
email me off list as it is a little to much for posting.
Personal preference to build line-by-line; it makes reading the code
easier. "." (dot, full stop, period) is the PHP concatenation
operator:

$message = "Facility: $Facility\n";
$message .= "First name: $FirstName\n";
....


--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php


Reply With Quote
  #4  
Old   
Bob Boisvert
 
Posts: n/a

Default Re: Email forms in PHP (long) Need help - 07-01-2004 , 10:52 PM



Thanks Jasper and Joe, It's working fine now, I wasn't clear on how the
variables were being defined in the $message = "" until I realized that the
$Facility\n had to be preceded by Facility: and so on.

Bob


"Jasper Allibang Espejo" <jasperespejo (AT) hotmail (DOT) com> wrote

Quote:
Take a look at your code. You placed all your variables in the wrong
places!!! Name contains the value of $Facility, Facility contains the
value
of $Firstname, etc...

$message = "

Name: $Facility \n
Facility: $FirstName \n
FirstName: $LastName \n
LastName: $Title \n
Title: $Dept \n
Dept: $Address \n
Address: $Phone \n
Phone: $Fax \n
Fax: $Email \n
Email: $Comments \n
Comments
";

--
Jasper Allibang Espejo
:: www.juantamad.com ::




"Bob Boisvert" <webdad (AT) tampabay (DOT) rr.com> wrote in message
news:cc2d5s$8gd$1 (AT) forums (DOT) macromedia.com...
Hi All,

I need Help! In more ways than one but lets stick with PHP coding for
now.
By the way, I know nothing about PHP but have to use it because that's
what
the clients host supports.

I have simple form I have created and am using PHP to process the
information, all information is being passed but I having a hang up and
I
can't find out what's causing it. The hang up is that when the
information
is being received after being submitted through the web site, all field
information in the received email is one field above where it should be,
and
I'n getting an extra name field in the email. An example is below: The
form
is here http://www.ccrmed.com/Testing/catalog_request.html

Name: Office (this should not be here, office should be on the
facility.)

Facility: first name

FirstName: last name

LastName: title

Title: dept

Dept: address

Address: phone

Phone: fax

Fax: email

Email: comments

Comments

This is what's handling the processing: The referring URL for the PHP
code
I
have is here http://www.webreference.com/programming/php/phpemail/ of
course
I modified it to include the other fields that I have.

{
$message = "Name: $Facility\nFacility: $FirstName\nFirstName:
$LastName\nLastName: $Title\nTitle: $Dept\nDept: $Address\nAddress:
$Phone\nPhone: $Fax\nFax: $Email\nEmail: $Comments\nComments";
$extra = "From: $FirstName\r\nReply-To: $Email\r\n";
mail ("email (AT) email (DOT) com", "Catalog Request", $message, $extra);
echo "<p class=bodymd>Thanks for your inquiry, $FirstName.</p>";
echo "<p class=bodymd>We'll respond to $Email as soon as
possible.</p>";
}

Can anyone shed some light on this and tell me why the email is
processing
the way it is. If you need the rest of the code, please email me off
list
as
it is a little to much for posting.



Thanks,

Bob









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.