mparlett Posted November 18, 2008 Share Posted November 18, 2008 Hello! I am new to PHP and am trying to process a form with a PHP script, but when I test, it says I have a programming error. I don't see it. Can you help? I am working in Dreamweaver CS3. Thanks! <?php /*Subject and Email Variables */ $emailSubject = 'Survey Response'; $webMaster = 'melody.parlett@unt.edu'; /* gatering data variables */ $easyField = $_POST['easy'] $confidentialField = $_POST['confidential'] $neutralField = $_POST['neutral'] $listenedField = $_POST['listened'] $optionsField = $_POST['options'] $resourceField = $_POST['resource'] $satisfiedField = $_POST['satisfied'] $referralField = $_POST['referral'] $commentsField = $_POST['comments'] $body = <<<EOD <br><hr><br> It was easy to contact the ombuds office: $easy <br> The Ombuds provided a safe confidential environment: $confidential <br> The Ombuds maintained neutrality: $neutral <br> The ombuds listened to my concerns: $listened <br> The Ombuds helped identify options to resolve my issue: $options <br> Could another resource have been more effective: $resource <br> Overall I am satisfied with the Ombuds service: $satisfied <br> How did you hear about the Ombuds office: $referral <br> Additional comments: $comments <br> EOD; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as HTML */ $theResults = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> Thank you for participating in our survey! </body> </html> EOD; echo "$theResults"; ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted November 18, 2008 Share Posted November 18, 2008 Would help if you posted the error and the line number it's on, but one big error is you are missing semi colons on each of these lines $easyField = $_POST['easy'] $confidentialField = $_POST['confidential'] $neutralField = $_POST['neutral'] $listenedField = $_POST['listened'] $optionsField = $_POST['options'] $resourceField = $_POST['resource'] $satisfiedField = $_POST['satisfied'] $referralField = $_POST['referral'] $commentsField = $_POST['comments'] Quote Link to comment Share on other sites More sharing options...
jjacquay712 Posted November 18, 2008 Share Posted November 18, 2008 lol Quote Link to comment Share on other sites More sharing options...
DarkWater Posted November 18, 2008 Share Posted November 18, 2008 lol What a useful post! Anyway, every* statement in PHP (and pretty much every programming language) requires a terminating semicolon. *Except a few things like if/elseif/else statements and loops**, which don't take a semicolon. ** do/while loops need a semicolon. Quote Link to comment Share on other sites More sharing options...
htzone Posted November 19, 2008 Share Posted November 19, 2008 You might find this useful: http://www.meandeviation.com/tutorials/learnphp/php-syntax-check/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.