0

Hello would appreciate any help having problems with this code.

       value="<?phpif($_GET['level']== "Grade 2"){ echo "Grade 3";}?>"

My idea is having an if else on this text element so it may check the level of the student and once its checks it should progress the student by a certain level so far i have this error.

Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\Thesis\enrollpage.php on line 212

Also i have this problem, It cannot retrieve $_GET['level'] i tried using get to retrieve from this from and post from the previous from but still not working.

4

2 回答 2

4

您需要在<?php和您的第一条语句之间留一个空格:

<?php if($_GET['level']== "Grade 2"){ echo "Grade 3";}?>
于 2012-09-04T14:07:37.430 回答
1
  value="<?php if($_GET['level'] == 'Grade 2'){ echo 'Grade 3';} ?>"
于 2012-09-04T14:08:55.690 回答