Skip to main content
Participant
May 26, 2006
Question

PHP mailto problems

  • May 26, 2006
  • 2 replies
  • 542 views
Hi, i am developing a PHP powered form for visitors to leave feedback on our website. Can anyone suggest a reason why it is only returning the email address and no other infromation entered please?

the PHP script is as follws:

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "example@example.com", "Customer Feedback Form Results",
"$message\nTitle: $title\nForename: $forename\nSurname: $surname\nEmail Address: $email\nAddress Line 1: $address1\nAddress Line 2: $address2\nAddress Line 3: $address3\nPost Code: $postcode\nTelephone: $telephone\nFax: $fax\nQuestion1: $question1\nQuestion2: $question2",
"From: $email" );
header( "Location: http://www.example.com/feedbackreceived.htm" );
?>

Thanks in advance for any help!
Dan
This topic has been closed for replies.

2 replies

Inspiring
May 26, 2006
Give the full location of the variables eg

$forename should be:

$_POST['forename'];

You should always give the reference to the location that the variables are
coming from when you code ie:

$_GET['variable_name'] - For a variable from a URL or a form sent with the
GET method
$_POST['variable_name'] - For a variable coming from a form sent with the
POST method (standard way)
$_COOKIE['variable_name'] - For a variable that comes from a cookie
$_SESSION['variable_name'] - For a variable that comes from a session
variable

The old way of just using the name eg $forename instead of
$_POST['forename'] is deprecated because its insecure

Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.


Inspiring
May 26, 2006
Show me the HTML for the form, please. I'm guessing that your form does not
contain a field called "message".

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"dangeorge the man" <webforumsuser@macromedia.com> wrote in message
news:e56t0r$bcl$1@forums.macromedia.com...
> Hi, i am developing a PHP powered form for visitors to leave feedback on
> our
> website. Can anyone suggest a reason why it is only returning the email
> address and no other infromation entered please?
>
> the PHP script is as follws:
>
> <?
> $email = $_REQUEST['email'] ;
> $message = $_REQUEST['message'] ;
>
> mail( "example@example.com", "Customer Feedback Form Results",
> "$message\nTitle: $title\nForename: $forename\nSurname: $surname\nEmail
> Address: $email\nAddress Line 1: $address1\nAddress Line 2:
> $address2\nAddress
> Line 3: $address3\nPost Code: $postcode\nTelephone: $telephone\nFax:
> $fax\nQuestion1: $question1\nQuestion2: $question2",
> "From: $email" );
> header( "Location: <a target=_blank class=ftalternatingbarlinklarge
> href=" http://www.example.com/feedbackreceived.htm"">http://www.example.com/feedb
> ackreceived.htm"</a> );
> ?>
>
> Thanks in advance for any help!
> Dan
>
>


Participant
May 26, 2006
the html is attached, thanks, Dan