Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

PHP Contact form not working the right way

Posted on 2011-10-06
5
Medium Priority
?
280 Views
Last Modified: 2012-06-22
i cant figure out why my elite contact form is not working the right way.. the issue is that i want the $to_name to be Carlyle on the Green, and I have done a quick test and the form says To: julie@targetgroupmedia.com when it supposed to say To:Carlyle on the Green.. bellow is the php code.. any help would be apprecated..

 PLEASE dont help me if you are going to complain about a score you will get or how much you will be awarded after you aswer.. Who ever answers always gets an A..

thanks for your KIND help


<?php
$sendTo        = "julie@targetgroupmedia.com";
                    
$subject = "Carlyle On The Green Email Submission Form";
$to_name       = "Carlyle on the Green";
$lastname = $_GET['lastname'];
$email = $_GET['email'];
$name = $_GET['name'];
$weddings = $_GET['weddings'];
$socialevents = $_GET['socialevent'];
$corporateevents = $_GET['corporateevent'];
$holidayevents = $_GET['holidayevent'];
$taste99 = $_GET['taste99'];
$alltheabove = $_GET['alltheabove'];

// send mail
$headers  = "From: $email\r\n";
// $headers .= 'MIME-Version: 1.0' . "\r\n";
// $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
          
$msg = "Carlyle on the Green Mailing List Submission :\n\nName:".$name." \n\nLast Name:".$lastname." \n\nE-mail:".$email."\n\nWeddings:".$weddings." \n\nSocial Events:".$socialevent." \n\nCorporate Events:".$corporateevent." \n\nHoliday Events:".$holidayevent." \n\nTaste 99:".$taste99." \n\nAll The Above:".$alltheabove."";
            
mail($sendTo, $subject, $msg, $headers);

echo "status=formOk";
            
?>
0
Comment
Question by:julianne26
5 Comments
 
LVL 10

Accepted Solution

by:
Derokorian earned 1000 total points
ID: 36925114
Change:
$sendTo        = "julie@targetgroupmedia.com";
To:
$sendTo        = "Carlyle on the Green <julie@targetgroupmedia.com>";

HTH
0
 
LVL 13

Assisted Solution

by:haloexpertsexchange
haloexpertsexchange earned 1000 total points
ID: 36925138
did you try doing the $sendTo like this "Carlyle on the Green <julie@targetgroupmedia.com>"?
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 36925167
Sorry, but what form you're talking about? I can't see any form in your code: how you fill the form? I only see that $sendTo is set to
"julie@targetgroupmedia.com" and that in mail() mfunction you use $sendTo and $to_name varuable is never used in code you posted here... Maybe you need to post some more code... or I'm stupid
0
 

Author Comment

by:julianne26
ID: 36925402
this is an old code form someone else.. thats why it might be a little off.. thats all the code.. if i need to add something else to the code to make it work then let me know.. i know as much as you know at this point and no your not stupid..
0
 

Author Comment

by:julianne26
ID: 36925558
THANKS Derokorian AND haloexpertsexchange  you guys solved it..
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question