TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Programming > PHP
PHP The most widely used server-side programming language for web applications.

Reply
 
Thread Tools Display Modes
Old May 5th, 2010, 12:25 PM   #1 (permalink)
Toni E
Guest
 
Posts: n/a
Default What's wrong with this PHP?

Hi I am really lost on what I'm doing wrong. I don't really have a full grasp of PHP and intend to learn it this summer but right now I need to get this form to work so I followed a tutorial and am getting and error when I go to submit the page. Can you see any obvious problems in my code? Or should I not have the html embedded in the php file?

Here is my form page: (php code listed after) https://webservices.missouriwestern.edu/users/aembrey/act202/Publish/Final%20Project/MShoogys/contactus.html

Here is the code I am using. (Thank You)...

<?php

/*Subject and email variables */

$emailSubject = 'Crazy PHP Scripting!';
$webMaster = 'hallyvaux@gmail.com';

/* Gathering Data Variables */
$emailField = $_POST['email'];
$nameField = $_POST['name'];
$phoneField = $_POST['phone'];
$commentsField = $_POST['comments'];

$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone: $phone <br>
Comments: $comments <br>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n":
$success = mail($webMaster, $emailSubject, $body, $headers);

/* Resulsts rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>Email Results</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
-->
</style>
</head>
原帖地å€: TechSpott - Computer and technology forums http://www.techspott.com//showthread.php?p=12867

<div>
<div align="left">Thank you for your interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

?>
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
php, wrong


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong with THIS php? Toni E PHP 0 May 5th, 2010 12:21 PM
What's wrong with my php? Toni E PHP 0 May 5th, 2010 10:43 AM
Anyone know what is wrong with this php code? LAL PHP 0 May 3rd, 2010 09:20 PM
anything wrong with this PHP code? MyPrizeShop PHP 0 April 23rd, 2010 07:17 PM
What's wrong with this PHP code? ?pathtotake? PHP 0 April 23rd, 2010 01:25 PM

 
Forum Stats
Members: 14,314
Threads: 20,322
Posts: 27,656
Total Online: 35

Newest Member: Webchatfep

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 04:09 AM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO