stig39 Posted April 30, 2007 Share Posted April 30, 2007 Hi All, I am recieving the following error on line 14: unexpected T_ELSE <? if($submit_1) { $b=$_POST['input_1_10']; $b1=$_POST['input_1_12']; $b2=$_POST['input_1_14']; $b3=$_POST['input_1_16']; $b4=$_POST['input_1_18']; $b5=$_POST['input_1_20']; $b6=$_POST['input_1_22']; $b7=$_POST['input_1_24']; if ($b=="" and $b1=="" and $b2=="" and $b3=="" and $b4=="" and $b5=="" and $b6=="" and $b7=="") {echo else $a = array($b, $b1, $b2, $b3, $b4, $b5, $b6, $b7); include ("ajstatistics.php"); $standard_deviation = standard_deviation_population ($a); $proc=$a[0] / $standard_deviation * 100; $sk="100"; ?> Link to comment https://forums.phpfreaks.com/topic/49368-solved-simple-error/ Share on other sites More sharing options...
pocobueno1388 Posted April 30, 2007 Share Posted April 30, 2007 <?php if($submit_1) { $b=$_POST['input_1_10']; $b1=$_POST['input_1_12']; $b2=$_POST['input_1_14']; $b3=$_POST['input_1_16']; $b4=$_POST['input_1_18']; $b5=$_POST['input_1_20']; $b6=$_POST['input_1_22']; $b7=$_POST['input_1_24']; if ($b=="" and $b1=="" and $b2=="" and $b3=="" and $b4=="" and $b5=="" and $b6=="" and $b7=="") { echo "what?"; //You didn't put anything to echo??? } else { //Forgot your curly brackets $a = array($b, $b1, $b2, $b3, $b4, $b5, $b6, $b7); include ("ajstatistics.php"); $standard_deviation = standard_deviation_population ($a); $proc=$a[0] / $standard_deviation * 100; $sk="100"; } //You need to close both IF statements } ?> I commented throughout your code to show you what I corrected. My code is untested, but see if it works now. Link to comment https://forums.phpfreaks.com/topic/49368-solved-simple-error/#findComment-241903 Share on other sites More sharing options...
stig39 Posted April 30, 2007 Author Share Posted April 30, 2007 Thanks that seems to be working for the moment jane Link to comment https://forums.phpfreaks.com/topic/49368-solved-simple-error/#findComment-241915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.