0

Hello,

Can anyone help me fix this error?

step_3.php

echo '<option value="'.$_SESSION['application']['year'][$i].'"'
                .if($y = $_SESSION['application']['year'][$i]).{'"selected"; >'}.$y.'</option>';

Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\pergas-responsive\include\ars_application_submission_step_3.php on line 125

3
Contributors
2
Replies
14
Views
2 Years
Discussion Span
Last Post by diafol
0

You... Have an unexpected if.. You can't concat with a logical step like you are doing... And if you read your code closely you will see you are not actually doing a logical operation at all, as there is no outcome.

Instead of doing dot notation to concat, try writing it the long way and see where all your errors are...

To do a logical concat like you expect you will need to use a ternary logical statement.

Edited by ryantroop

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.