one who can solve this php code ^ echo "<option><?php echo htmlspecialchars( $Player[ 'Name' ] ); ?></option>"; ^ And the error on the page http://gyazo.com/aaf5d029a1da9d52ea3341dd01e55960
mathiaslisborg.jakobsen
0
Newbie Poster
Recommended Answers
Jump to PostFirst Point:
Well what the hell am I meant to solve if I don't even know what the error message is?echo "<option><?php echo htmlspecialchars( $Player[ 'Name' ] ); ?></option>";
isn't good enough my friend.Second Point:
Can you provide some source code ofreport.php
and give us a bit of …
Jump to PostJust a quick notice on formatting... Does PHP allow
$Player[ 'Name' ]
? Shouldn't it be$Player['Name']
(notice the white spaces)?Also, I am not sure there is
Is_Array()
but there isis_array()
... The language is case-sensitive!
Jump to PostHeres something based on what we've said so far:
if(is_Array($Players)){ foreach($Players as $Player) { $option = htmlspecialchars($Player['Name']); echo "<option>". $option."</option>"; } }
Neaten your code up and make it consistant.
The above should solve your problem, if not, check that
$Players
array contains the correct …
Jump to Postpost the actual error message, not a link.
follow the instructions you have been givenPlease... pretty please... "mod speaking" - paste your code and errors directly into this thread.
'mod' is the bloke who kicks your ass off the site when you annoy them enough
Jump to Postforeach( $Players as $Player ) { echo "<option> htmlspecialchars( $Player[ 'Name' ] </option>"; echo '</select'>; }
The
</select>
should be outside the loop otherwise you'll get multiple close select tags.
All 25 Replies
mattster
195
Practically a Master Poster
Featured Poster
mathiaslisborg.jakobsen
0
Newbie Poster
Taywin
312
Posting Virtuoso
mathiaslisborg.jakobsen
0
Newbie Poster
mathiaslisborg.jakobsen
0
Newbie Poster
mattster
195
Practically a Master Poster
Featured Poster
diafol
Taywin
312
Posting Virtuoso
mathiaslisborg.jakobsen
0
Newbie Poster
diafol
mathiaslisborg.jakobsen
0
Newbie Poster
diafol
diafol
mathiaslisborg.jakobsen
0
Newbie Poster
diafol
mathiaslisborg.jakobsen
0
Newbie Poster
almostbob
866
Retired: passive income ROCKS
diafol
mathiaslisborg.jakobsen
0
Newbie Poster
mathiaslisborg.jakobsen
0
Newbie Poster
almostbob
866
Retired: passive income ROCKS
mathiaslisborg.jakobsen
0
Newbie Poster
almostbob
866
Retired: passive income ROCKS
diafol
almostbob
commented:
the post immediately above, :sad face:
+13
Mocabilly
14
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.