i am new to php coding and i am getting an error please help me to solve this
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' <option<?php if ( get_settings( $value['id'] ) == $option) { echo ‘ selected="selected" } elseif ($option == $value['std']) { echo ‘ selected="selected" } ?><?php echo $option; ?></option>
justzamir
0
Newbie Poster
Recommended Answers
Jump to PostIn
{ echo ' selected="selected" }
, the PHP string isn't closed.
Jump to Post<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?><?php echo $option; ?></option>
This might be clearer:
<option <?php echo (get_settings($value['id']) == $option or $option == $value['std']) ? 'selected="selected"' : '' …
Jump to Postyou alsso used a backtick ` in stead of a single quote '
Jump to Postok getting same error
Compare with the previous example. Am positive you can fix this yourself. Look at the quotes.
All 14 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
justzamir
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
pzuurveen
90
Posting Whiz in Training
justzamir
0
Newbie Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
justzamir
0
Newbie Poster
diafol
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
justzamir
0
Newbie Poster
asprin
14
Newbie Poster
justzamir
0
Newbie Poster
diafol
justzamir
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.