View Full Version : syntax unexpected T_DOUBLE_ARROW (help)

04-23-2011, 05:24 AM
please bare with me, as i'm not a coder and am trying my best with this stuff =/

i'm trying to modify a calculator form script in php for my wordpress, and got this error from the following section of code. can anyone shed some light on this? any help is greatly appreciated :)

Parse error: syntax error, unexpected T_DOUBLE_ARROW

here's the code: any ideas on how to fix this? (sorry for the sloppy code. i'm trying lol)

// is it less than 1450?
if($calories_daily<1450 && $_POST["Goal"]=='build_muscle') $meal_plan_2000=true;
else $meal_plan_2000=false;

// is it between 1450 and 2050?
if($calories_daily=>1450 && $calories_daily<2050 && $_POST["Goal"]=='build_muscle') $meal_plan_2500=true;
else $meal_plan_2500=false;

// is it 2050 or more?
if($calories_daily=>2050 && $_POST["Goal"]=='build_muscle') $meal_plan_3000=true;
else $meal_plan_3000=false;

//the result is here
$wl_calc.='<div class="wlc_table" '.$inline_style.'>';

$wl_calc.='<div style="color:red;font-weight:bold;border:0pt solid black;">Whoa! Your goal requires you to lose '.number_format($pounds_daily*7).' pounds per week; this is unhealthy and potentially dangerous. Please reconsider your goal and try again.</div>';

$wl_calc.='Based on your info, the <a href="http://powerhousegourmet.com/2000-calorie-plan/" target="_blank">2000 Calorie Plan</a> is perfect for you!';

$wl_calc.='Based on your info, the <a href="http://powerhousegourmet.com/2500-calorie-plan/" target="_blank">2500 Calorie Plan</a> is perfect for you!';

$wl_calc.='Based on your info, the <a href="http://powerhousegourmet.com/3000-calorie-plan/" target="_blank">3000 Calorie Plan</a> is perfect for you!';

$wl_calc.='Based on your info, the <a href="http://powerhousegourmet.com/weightloss/" target="_blank">Gold Plan</a> is perfect for you!';

$wl_calc.='Based on your info, the <a href="http://powerhousegourmet.com/mealplanone/" target="_blank">Meal Plan One</a> is perfect for you!';

$wl_calc.='Based on your info, the <a href="http://powerhousegourmet.com/musclebuilding/" target="_blank">Titanium Plan</a> is perfect for you!';

$wl_calc.='<hr><h3>Suggested Daily Intake = <b>'.$calories_daily.' Calories</b></h3><p><hr></p><p>You would need to consume '.$calories.' calories per day to maintain your current weight. To lose '.$_POST["lose_lb"].' lbs in '.$_POST["days"].' days you must consume no more than '.$calories_daily.' calories per day.</p><p><hr></p>
<p align="center"><a href="http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'">Recalculate</a></p>


04-23-2011, 06:44 AM

if ($calories_daily=>1450 && ...
...should read like this:

if ($calories_daily>=1450 && ...
Change all other similar instances as well.