Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    syntax unexpected T_DOUBLE_ARROW (help)

    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)

    Code:
    // 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>';
    		
    	}
    Last edited by ShaneC; 04-23-2011 at 05:25 AM. Reason: Merged first and this post, corrected tags

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    This:
    PHP Code:
    if ($calories_daily=>1450 && ... 
    ...should read like this:
    PHP Code:
    if ($calories_daily>=1450 && ... 
    Change all other similar instances as well.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •