Hi all:
I have a drop down field with a variable in it. the variable may contain an apostrophe. This is causing problems.
Here is the code:
echo "<option value='".$row['player']."|".$row['plID']."'>".$row['player']."</option>/r/n";
Here is the source code:
<option value=''Ace' Parker|0cf9bbe0b9a00b27d93ef14a0bd5a9db8ec3a1ef'>'Ace' Parker</option>
When 'Ace' Parker is the player variable that first apostrophe closes the <option value>.
I have tried addslashes, htmlentities and strip slashes. Not sure what the right trick is for this. I see a lot of info for adding the vaibale to MySQL but nothing for this.
Any help appreciated