vato116 Posted February 14, 2013 Share Posted February 14, 2013 I keep getting this error message: Parse error: syntax error, unexpected 'Your' (T_STRING) in C:\xampp\htdocs\Salary.php on line 8. <?php $h=$_GET['hours']; $r=$_GET['rate']; $p=$_GET['pay']; if ($h <= 40){ $submit = ("$p = $h * $r) echo "Your Weekly Salary Is: $p; } if ($h > 40){ $submit = ("$p = ($h *$r) + (($h - 40) * $r * 1.5)") echo "Your Weekly Salary Is: $p; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/274472-simple-php-help/ Share on other sites More sharing options...
Jessica Posted February 14, 2013 Share Posted February 14, 2013 Line 7 is all kinds of wrong. Close the string and then end the line. Quote Link to comment https://forums.phpfreaks.com/topic/274472-simple-php-help/#findComment-1412383 Share on other sites More sharing options...
vato116 Posted February 14, 2013 Author Share Posted February 14, 2013 Sorry. I have no idea what that means. This is what i did. <?php $h=$_GET['hours']; $r=$_GET['rate']; $p=$_GET['pay']; if ($h <= 40){ ("$p = $h * $r); echo "Your Weekly Salary Is: ".$p; } if ($h > 40){ ("$p = ($h *$r) + (($h - 40) * $r * 1.5)"); echo "Your Weekly Salary Is: ".$p; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/274472-simple-php-help/#findComment-1412384 Share on other sites More sharing options...
vato116 Posted February 14, 2013 Author Share Posted February 14, 2013 (edited) Okay, so I managed to change some thing. This is what i got, but now its telling me this: Notice: Undefined index: pay in C:\xampp\htdocs\Salary.php on line 4 Your Weekly Salary Is: <?php $h=$_GET["hours"]; $r=$_GET["rate"]; $p=$_GET["pay"]; if ($h <= 40){ $submit = ("$p = $h * $r"); echo "Your Weekly Salary Is: ".$p; } if ($h > 40){ $submit = ("$p = ($h *$r) + (($h - 40) * $r * 1.5)"); echo "Your Weekly Salary Is: ".$p; } ?> Edited February 14, 2013 by vato116 Quote Link to comment https://forums.phpfreaks.com/topic/274472-simple-php-help/#findComment-1412386 Share on other sites More sharing options...
vato116 Posted February 14, 2013 Author Share Posted February 14, 2013 Got it to work I had to remove the $_GET from $p Quote Link to comment https://forums.phpfreaks.com/topic/274472-simple-php-help/#findComment-1412392 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.