[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

4.6

PHP mail() function not passing variables from form data

Asked by digigirl1124 in Scripting Languages, WebApplications, PHP for Windows

Tags: PHP with Windows Server and MySQL

I have tried everything... searched the net for days looking for this answer:
I have set up a registration page and once the user register and submits, an email confirmation is mailed to the email address provided in the form.
I am using PHP mail() -- code below-- on a Windows platform.  The email is delivered to the address hardcoded into the To: line fine, but will not read from the form data variables.  I have even tried a SELECT statement to call the data back out of the database and use that variable to insert into the mail() function, but it will NOT SHOW THE value of the variable --- it doesn't even show a placeholder for the variable, unless I use a single quote ' around the variable... then it prints the variable itself.  I WANT IT TO PRINT THE VALUE OF THE VARIABLES!!!  Does anyone know how this is accomplished???  Thanks so much..   code below
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
MAIL PROBLEM
****************************************************************************
$varFrom = "warrantyrequest@thecompany.com";
$emailTo1 = "$d_email";  // the database variable
$emailTo2 = "myemail@gmail.com"; // my hardcoded email address
$emailTo3 = "$mailEmail"; // the result of the SELECT statement used just before this
$varTo = "$emailTo1 , $emailTo2, $emailTo3";
$varSubject = "Dealer Portal Registration";
$msgBody = "";
 
/*****************************************************************************
NOT USING THIS SECOND OPTION WITH HTML IS COMMENTED OUT
*****************************************************************************
$msgBody = ' 
<html>
<head><title>DEALER PORTAL REGISTRATION</head>
<body>
<p>Dear:$varTo</p></b>
<p>Thank you for registering for an account with Bad Boy Dealer Portal!</br>
To activate your membership, please click here: 
<a href="http://www.badboydealerportal.com/activate.php?id=$userid&code=$db_password">Activate my account!</a>
</br>
Once you activate your memebership, you will be able to login with the following:<br>
Username: $dealer_email</br>
Password: $random_password</br>
Thanks! From Joe at Bad Boy Buggies
This is an automated activation e-mail, please do not reply!
</body>
</html>
';    *************************************************************************
                          END OF COMMENTED OUT SECTION*/
/*******************************************************************************
GOOD TO USE************************************************************/
$msgBody = "Dear:" ."$var1"."\r\n";
$msgBody .= "Thank you for registering for an accountl!"."\r\n";
$msgBody .= "To activate your membership, please go to:" ."\r\n"; 
$msgBody .= "http://www.thecompany.com to Log In" ."\r\n";
$msgBody .= "Once you Login, your account will activate." ."\r\n";
$msgBody .= "Your Email is:". $mailEmail. 'or' . $d_email ."\r\n";
$msgBody .= "Your Password is:" .$dpassword . "and" . $rowPass. "\r\n";
$msgBody .= "Thank You! From Joel " ."\r\n";
"This is an automated activation e-mail, please do not reply!" ."\r\n";
//COMMENTED OUT
/**************************************************************************
**********************TRIED TO SEND LINK WITH USERID AND PASSWORD
DID NOT WORK ************ SENT TO BROWSER BUT STOPPED, NO ERROR
MESSAGE, OR NO CONGRATULATIONS MESSAGE*************************
$msgBody .=
 "To activate your membership, please click here:"."\r\n"; 
"<a href=\"http://www.companylink.com/activate.php?id=$userid&code=$db_password">"Activate my account"."</a>" ."\r\n";*/
//$message = wordwrap($msgBody, 70);
/*************************************************************************
GOOD TO USE*******WITH OTHER FROM ABOVE NOT COMMENTED OUT*****************************************************
**************************************************************************/
$varMailHeader = "";
$varMailHeader .= "From: ".$varFrom."\r\n"; 
$varMailHeader .= "CC: myotherEmail@aim.com"."\r\n";
$varMailHeader .= "Return-Path: ".$varFrom."\r\n";
$varMailHeader .= "Return-Receipt-To: ".$varFrom."\r\n";
$varMailHeader .= "Reply-To: warrantyrequest@thecompany.com"."\r\n";
$varMailHeader .= "X-Mailer:PHP/".phpversion()."\r\n";
 
$mailsend = mail($varTo, $varSubject, $msgBody, $varMailHeader);
//echo $mailsend;
if ($mailsend)
{
    echo "Your registration was successful $d_email!  A confirmation is being emailed to the Email address you provided.  Follow the instructions in that email to login to your account";
    }
[+][-]07/02/09 09:22 PM, ID: 24769791Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 09:33 PM, ID: 24769838Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 09:43 PM, ID: 24769881Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 09:54 PM, ID: 24769939Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 09:58 PM, ID: 24769967Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 10:14 PM, ID: 24770027Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 10:19 PM, ID: 24770048Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 10:19 PM, ID: 24770050Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 10:21 PM, ID: 24770065Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 10:25 PM, ID: 24770079Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 10:25 PM, ID: 24770081Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 10:29 PM, ID: 24770095Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 10:32 PM, ID: 24770106Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 10:48 PM, ID: 24770169Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 10:51 PM, ID: 24770182Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 10:53 PM, ID: 24770188Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 11:00 PM, ID: 24770228Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 11:04 PM, ID: 24770249Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 11:20 PM, ID: 24770321Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/03/09 11:55 AM, ID: 24773931Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/03/09 12:14 PM, ID: 24774007Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/03/09 06:48 PM, ID: 24775330Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/03/09 09:03 PM, ID: 24775670Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/03/09 10:00 PM, ID: 24775761Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/03/09 10:13 PM, ID: 24775811Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/04/09 10:32 AM, ID: 24777436Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Scripting Languages, WebApplications, PHP for Windows
Tags: PHP with Windows Server and MySQL
Sign Up Now!
Solution Provided By: digigirl1124
Participating Experts: 1
Solution Grade: A
 
[+][-]07/09/09 12:32 AM, ID: 24811328Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20090701_SELECT_ZONES