I get a parse error saying unexpected '$' on the very last line
<? $To= 5; if ($To <= 25.00) { $TotShipping = 5.95; } else { if ($To <= 50.00) { $TotShipping = 6.95; } else { if ($To <= 75.00) { $TotShipping = 8.95; } else { if ($To <= 100.00) { $TotShipping = 10.95; } else { if ($To <= 125.00) { $TotShipping = 11.95; } else { if ($To <= 150.00) { $TotShipping = 13.95; } else { if ($To <= 175.00) { $TotShipping = 15.95; } else { if ($To <= 200.00) { $TotShipping = 16.95; } echo "$TotShipping "; ?>
Here is the way you are doing this in a syntactly correct form. [edit] See fulco's code below. [/edit] I would suggest going through some tutorials to see the correct way to do if statements. Also check into case statements, as a case statement would have been a better option here.
Parse error: parse error, unexpected T_IF, expecting '(' in /www/e/empireind/htdocs/Cart/testdescription.php on line 6
do you have any good tutorials for me to check out? thanks
Try this:
<?php $To= 5; if ($To <= 25.00) { $TotShipping = 5.95; } elseif ($To <= 50.00) { $TotShipping = 6.95; } elseif ($To <= 75.00) { $TotShipping = 8.95; } elseif ($To <= 100.00) { $TotShipping = 10.95; } elseif ($To <= 125.00) { $TotShipping = 11.95; } elseif ($To <= 150.00) { $TotShipping = 13.95; } elseif ($To <= 175.00) { $TotShipping = 15.95; } elseif ($To <= 200.00) { $TotShipping = 16.95; } echo "$TotShipping "; ?>
Just had an extra if in it.
Hope this helps.
For a very basic tutorial that covers php try http://www.webmonkey.com