Link to home
Start Free TrialLog in
Avatar of NewWebDesigner
NewWebDesigner

asked on

why am I getting a syntax error for this ridiculously easy code?

using dreamweaver, I am getting a syntax error for this very easy code:

<?php
 if isset($_POST['action']) {
	 
	 echo "lalala";
}

?>

Open in new window

Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Is that the only code on the page?
Avatar of NewWebDesigner
NewWebDesigner

ASKER

yes
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
padas gave you the correct code, but the reason is that you have to surround the conditional with ().


if (something) {
  dosomething;
}
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial