lbombardier wrote:
> I'm somehwat new to PHP in Dreamweaver but understand it
well enough to be
> totally confused as to why I'm getting the following
error on page load:
>
> Parse error: syntax error, unexpected '{'
A parse error is caused by a mistake in your PHP code. There
are
actually four mistakes in your page. These are all mistakes
in your own
coding, not in anything generated by Dreamweaver. The first
is on line 2:
> <?php if ((isset($_POST['MM_insert'])) {
Remove the first opening parenthesis. It should look like
this:
<?php if (isset($_POST['MM_insert'])) {
The next error is on line 17:
> if ($totalRows_rsCart > 0 {
The closing parenthesis is missing from your conditional
statement:
if ($totalRows_rsCart > 0) {
The next mistakes are on lines 69 and 118:
> if ((isset($_POST["MM_insert"])) {
It's the same mistake as on line 2 (an extra opening
parenthesis):
if (isset($_POST["MM_insert"])) {
Parse errors are the most common beginner's mistakes in PHP.
When you
get a parse error, check that all quotes, parentheses,
braces, and
brackets are in matching pairs. Also check for missing
semicolons at the
end of commands. The error message tells you which line it
encountered a
problem. This is not always the location of the error, so you
need to
start looking backwards from that point if you can't find
anything wrong
on that particular line.
--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/