Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP submission form help

Posted on 2009-07-02
4
Medium Priority
?
391 Views
Last Modified: 2012-05-07
Hey EXPERTS!

Why doesn't this PHP work?  

I'll post 2 different PHP submission forms on the code part...  the TOP one is the new PHP that I took from my other website submission form and altered it for a new one.

The BOTTOM one is the working completely fine PHP form from my other website.

The problem with the TOP one is that when I hit submit, it doesn't show the email address as who it's from... also for some emails like on a godaddy.com server email... they don't even get it... if I submit from my other website to a godaddy.com server email it works just fine.

THANKS!
DJM
<?php
 
/* Subject and Email Variables */
 
	$emailSubject = 'The Art Bucket WEBSITE CONTACT!';
	$webMaster = 'djm@djmgraphix.com';
	
/* Gathering Data Variables */
 
	$ClientName= $_POST['ClientName'];
	$Email = $_POST['Email'];
	$Phone = $_POST['Phone'];
	$Referrals = $_POST['Referrals'];
	$ReferralsOther = $_POST['ReferralsOther'];
	$Promotions = $_POST['Promotions'];
	$Interests = $_POST['Interests'];
	
	$body = <<<EOD
<br><hr><br>
Name: $ClientName <br>
Email: $emailaddress <br>
Phone Number: $Phone <br>
Referrals: $Referrals <br>
Referrals Other: $ReferralsOther <br>
Promotions: $Promotions <br>
Interests: $Interests <br>
EOD;
 
	$headers = "From: $emailaddress\r\n";
	$headers .= "Content-type: text/html\r\n";
	$success = mail($webMaster, $emailSubject, $body, $headers);
	
/* Results rendered as HTML */
 
	$theResults = <<<EOD
 
 
 
 
 
_______________________________BOTTOM PHP_______________________________
 
 
 
 
 
 
<?php
 
/* Subject and Email Variables */
 
	$emailSubject = 'DJM Graphix Contact!';
	$webMaster = 'amanda@theartbucket.com';
	
/* Gathering Data Variables */
 
	$ClientName= $_POST['ClientName'];
	$emailaddress = $_POST['emailaddress'];
	$Phone = $_POST['Phone'];
	$Questions = $_POST['Questions'];
	$Deadline = $_POST['Deadline'];
	
	$body = <<<EOD
<br><hr><br>
Name: $ClientName <br>
Email: $emailaddress <br>
Phone Number: $Phone <br>
Question: $Questions <br>
Deadline: $Deadline <br>
EOD;
 
	$headers = "From: $emailaddress\r\n";
	$headers .= "Content-type: text/html\r\n";
	$success = mail($webMaster, $emailSubject, $body, $headers);
	
/* Results rendered as HTML */
 
	$theResults = <<<EOD

Open in new window

0
Comment
Question by:DJMgraphix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Jagarm
ID: 24768955
Check and make sure your form field names matches what you have in the $_POST.

For example the different between the bottom and top is that the top script is $_POST['email'] while the bottom is $_POST['emailaddress'], and that is a common mistake that even I make.
0
 
LVL 28

Accepted Solution

by:
gamebits earned 2000 total points
ID: 24768956
Try this

<?php
 
/* Subject and Email Variables */
 
      $emailSubject = 'The Art Bucket WEBSITE CONTACT!';
      $webMaster = 'djm@djmgraphix.com';
      
/* Gathering Data Variables */
 
      $ClientName= $_POST['ClientName'];
      $Email = $_POST['Email'];
      $Phone = $_POST['Phone'];
      $Referrals = $_POST['Referrals'];
      $ReferralsOther = $_POST['ReferralsOther'];
      $Promotions = $_POST['Promotions'];
      $Interests = $_POST['Interests'];
      
      $body = <<<EOD
<br><hr><br>
Name: $ClientName <br>
Email: $Emails <br>
Phone Number: $Phone <br>
Referrals: $Referrals <br>
Referrals Other: $ReferralsOther <br>
Promotions: $Promotions <br>
Interests: $Interests <br>
EOD;
 
      $headers = "From: $Email\r\n";
      $headers .= "Content-type: text/html\r\n";
      $success = mail($webMaster, $emailSubject, $body, $headers);
      
/* Results rendered as HTML */
 
      $theResults = <<<EOD
0
 

Author Comment

by:DJMgraphix
ID: 24769025
Yes Sir!

That did it!... Thank you very much!  (contact page CHECK) :)

http://www.djmgraphix.com/THE_ART_BUCKET/contact_us.html
0
 

Author Closing Comment

by:DJMgraphix
ID: 31599406
YES and YES!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
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…

704 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