Jump to content

Parse error unexpected $


cnl83

Recommended Posts

Im getting a
Parse error: parse error, unexpected $ in /home/apex/scormsource-www/classes/access_user/evaluation1submit.php on line 61

Does anyone see anything wrong with this code? The variables are passed over through a form.

[code]
<?php
$toAddress="[email protected]";
$recipientSubject="EVALUATION 1 FOR CME";
/* grabs the POST variables and puts them into variables that we can use */
$one=$_POST['one'];
$two=$_POST['two'];
$three=$_POST['three'];
$four=$_POST['four'];
$five=$_POST['five'];
$six=$_POST['six'];
$seven=$_POST['seven'];
$eight=$_POST['eight'];
$nine=$_POST['nine'];
$ten=$_POST['ten'];
$eleven=$_POST['eleven'];

//---------VALIDATION-------->
    if($one){//----> CHECK input
        }
        else{
            $error.="Please, go back and select a value<br>\n";//----> ERROR if no input
            }

//GENERALLY YOU WOULD HAVE A LONG LIST OF THE ABOVE CODE, but EXCELLENT IS DEFAULT!
//-------->ERROR FREE??
//The below line has to echo, because php tries to parse the shit
    if($error==""){
echo "<script language=\"javascript\">document.location.href=\"authenticated.php\"</script>";

//----------------------------------
$mailContent="--------CONTACT--------\n"
            ."Objectives: Stated learning objectives met.: ".$one."\n"
            ."Identify heart anatomy, muscle, chambers and vessels.: ".$two."\n"
            ."Describe heart physiology, including conduction pathways.: ".$three."\n"
            ."Differentiate waveform basics and their relationship to anatomy and physiology.: ".$four."\n"
            ."Demonstrate paper basics and heart rate determination.: ".$five."\n"
            ."Content : Relevant, valuable and adequate.: ".$six."\n"
            ."Presentation: Engaging, interactive, conducive to learning.: ".$seven."\n"
            ."Overall quality of this program.: ".$eight."\n"
            ."Practice:  Validates, incorporates change in practice.: ".$nine."\n"
            ."Effectiveness:  Met my personal objectives.    : ".$ten."\n\n--------ADDRESS/INFO--------\n"
            ."Other Comments: ".$eleven."\n";
            
//The following is for a receipt
//mail($email, $subject, $receiptMessage,"From:$toAddress");
//----------------------------------
mail($toAddress,$recipientSubject,$mailContent,"From:$toAddress");
//--->echo $mailContent;

?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/4960-parse-error-unexpected/
Share on other sites

[!--quoteo(post=355001:date=Mar 14 2006, 07:02 PM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Mar 14 2006, 07:02 PM) [snapback]355001[/snapback][/div][div class=\'quotemain\'][!--quotec--]
if($error==""){

No closing bracket on that. File you gave us has 50 lines, so it's tough to track down a bug on line 61.
[/quote]


Thanks! ti worked great!
Link to comment
https://forums.phpfreaks.com/topic/4960-parse-error-unexpected/#findComment-17476
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.