473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why won't my simple PHP script work?

I used Dreamweaver to build my site and on one of my pages I have a form. I used an online tutorial to build this php file for the form. But everytime a user submits the form it just goes to a blank page and none of the forms get sent to my email.

What is wrong with this code? Thank you for your help!


Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. /* Subject and Email Variables */
  4.  
  5.     $emailSubject = 'Sales Inquiry';
  6.     $webMaster = 'sales@endorsebro.com'; 
  7.  
  8. /* Gathering Data Variables */
  9.  
  10.     $name = $_POST['name']; 
  11.     $business_name = $_POST['business_name']; 
  12.     $phone_number = $_POST['phone_number']; 
  13.     $Email = $_POST['Email']; 
  14.     $website = $_POST['website']; 
  15.     $state = $_POST['state']; 
  16.     $budget = $_POST['budget']; 
  17.     $comments = $_POST['comments']; 
  18.  
  19.     $body = <<<EOD
  20. <br><hr><br>
  21. Name: $name <br>
  22. Business Name: $business_name <br>
  23. Phone Number: $phone_number <br>
  24. Email Address: $Email <br>
  25. Website: $website <br>
  26. State: $state <br>
  27. Budget: $budget <br>
  28. Comments: $comments <br>
  29. EOD; 
  30.  
  31.     $headers = "From: $email\r\n";
  32.     $headers .= "Content-type: text/html\r\n";
  33.     $success = mail($webMaster, $emailSubject, $body, $headers);
  34.  
  35. /* Results rendered as html */
  36.  
  37.  
  38.     $theResults = <<<EOD
  39. <html>
  40. <head>
  41. <title>Endorsebro</title>
  42. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  43. <style type="text/css">
  44. <!--
  45. body {
  46.     background-color: #f1f1f1;
  47.     font-family: Verdana, Arial, Helvetica, sans-serif;
  48.     font-size: 12px;
  49.     font-style: normal;
  50.     line-height: normal;
  51.     font-weight: normal;
  52.     color: #666666;
  53.     text-decoration: none;
  54. }
  55. -->
  56. </style>
  57. </head>
  58.  
  59. <div>
  60.   <div align="left">Thank you for your interest! We will be in contact soon!</div>
  61. </div>
  62. </body>
  63. </html>
  64.  
  65. EOD;
  66. echo "$theResults";
  67. }
  68. ?>
  69.  
Apr 14 '11 #1
1 1729
code green
1,726 Expert 1GB
It is probably not this code but the form HTML
Apr 14 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Barry G. Sumpter | last post by:
Complete newbie here. Just sorted out that myASP.asp will ONLY execute on c:\inetput\wwwroot when I access it thru http://localhost/myASP.asp but if I copy myASP.asp to a sub folder of...
1
by: FayeC | last post by:
I got this snippet online and for the life of me I can't seem to make it write the cookie.... The Flash has the labels mentioned in the code and I used the name=movie and the swconnect=true as...
6
by: John | last post by:
Whenever the following script is called, it always defaults to the default CASE (14.99) Why won't it recognise the other range of values? Please I need help. <script language="javascript"...
2
by: | last post by:
Simple script won't work. Why? function sendIt(module) { var flagged = document.form1.getElementById("e_flagger").value; if (module == 'test') { alert("Test OK:" + " " + flagged); } <form...
2
by: Paul | last post by:
Hi I have a control that is created with java script and am just trying to move it to the left. I tried the following but it had no effect, thanks. <input type="text" size ="26" id = "timer" value...
12
by: mantrid | last post by:
Can anyone see why this simple script doesnt make the element visible? It starts of as hidden but will not show when the button is clicked. This has worked for me before but I cannot see what is...
5
by: gray_slp | last post by:
I am designing a web survey using surveymonkey.com and discovered I could use javascript to modify their standard question formats much the same as can be done in myspace. I used this feature to...
4
by: RichardOnRails | last post by:
Hi, First, is this an appropriate NG for talking about debugging JavaScript in Aptana? Assuming it is, I'm trying to get a script to read an external text file and display the text somehow....
2
by: Nathan Sokalski | last post by:
I have the following code which allows you to drag a div in IE, and have it then move back to it's natural position when you release the mouse button: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...
10
by: Ohmster | last post by:
I am trying to use this cool script that some MIT guy wrote and it just does not work, I get a stream of errors when I try to run it. It is supposed to visit a URL and snag all of the pictures on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.