Monday, 2 October 2017

What's wrong? PHP Parse error: syntax error, unexpected '}', expecting ',' or ';' in





Me and my mate we're trying to solve this for over 1.5 hours, we are still getting the same and tried almost everything we could.



Could anyone help us do that?



This is error what we're getting:




PHP Parse error: syntax error, unexpected '}', expecting ',' or ';' in


And this is the code (line) it's happening on:



if(!isset($_POST['name'])) {echo"Please fill in a valid username"} else {$ok="$ok+1"}



It's PHP.



If anyone wants the full code here it is:




$ok=0;
if(isset($_POST['submit'])) {
if(!isset($_POST['name'])) {echo"Please fill in a valid username"} else {$ok="$ok+1"}
if(!isset($_POST['pass'])) {echo"Please fill in a valid password"} else {$ok="$ok+1"}

if($ok==2){
switch($_POST['name'],$_POST['pass']){
case "FORAEROND","FORAEROND2":



THIS IS THE TEXT THAT WILL SHOW IF USERNAME IS 'FORAEROND' AND PASSWROD IS 'FORAEROND2'


break;



/*case "FORAEROND5","FORAEROND6"; KEEP FOR LATER


THIS IS THE TEXT THAT WILL SHOW IF USERNAME IS 'FORAEROND5' AND PASSWROD IS 'FORAEROND6'


break;
*/

}
}
}



Thanks to everyone who will help. :)



EDIT:



We apologize to everyone, it was really stupid, somehow we deleted or forgot ';' behind the codes, this is really stupid and awkward.


Answer



You missed ;. Each statement must ends up with a semicolon in PHP.


No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...