cliftonbazaar Posted June 21, 2009 Share Posted June 21, 2009 The following code worked fine ... WHILE($names_show = mysql_fetch_array($character_names)) { //Lets loop through all the records echo "<option value=".$names_show['characterName'].">".$names_show['characterName']."</option>"; } ... until my brother tested my code and made his character have two names -> "El Farto". What this means is that print_r($_POST); produces Array ( [player_view] => El ) AND $temp = $_POST[player_view]; produces El How and what do I change so the space comes up in the name? Link to comment https://forums.phpfreaks.com/topic/163088-solved-spaces-in-a/ Share on other sites More sharing options...
Ken2k7 Posted June 21, 2009 Share Posted June 21, 2009 echo "<option value='".$names_show['characterName']."'>".$names_show['characterName']."</option>"; You have to use quotes. <option value=El Farto> would treat only El as the value. Farto is not valid xHTML so it's omited. <option value='El Farto'> will treat El Farto as the value. Link to comment https://forums.phpfreaks.com/topic/163088-solved-spaces-in-a/#findComment-860490 Share on other sites More sharing options...
cliftonbazaar Posted June 21, 2009 Author Share Posted June 21, 2009 Thanks, got it working now Link to comment https://forums.phpfreaks.com/topic/163088-solved-spaces-in-a/#findComment-860597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.