...

View Full Version : syntax unexpected T_DOUBLE_ARROW (help)



djelev8
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.'>';

if($high_risk_weight)
{
$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>';
}

if($meal_plan_2000)
{
$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!';
}

if($meal_plan_2500)
{
$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!';
}

if($meal_plan_3000)
{
$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!';
}

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

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

if($more_than_1400)
{
$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>
</div>';

}

kbluhm
04-23-2011, 06:44 AM
This:

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum