danp Posted December 5, 2009 Share Posted December 5, 2009 I'm stumped on this one. I found a really simple "skeleton" if you will for a roleplaying game in PHP on the internet. When you go to fight a monster in the drop-down menu in fight.php, and the monster has two or more words for a name, the whole name of the monster does not carry over to the battle.php script, just the first name. I've tried all kinds of formattings and have actually seen similar problems in other people's scripts. Any advice or tips to get this working? I'd appreciate it, and thank you in advance. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/184046-phpsql-not-grabbing-more-than-1-word/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 5, 2009 Share Posted December 5, 2009 The HTML being output by the following line is invalid - echo "<option value=$monster_name[$x]>$monster_name[$x]</option>"; The value='...' attribute needs to be enclosed in quotes to make valid HTML (and in fact everyone should be validating their resulting web pages at the w3.org validators to insure that they contain valid HTML/CSS.) Quote Link to comment https://forums.phpfreaks.com/topic/184046-phpsql-not-grabbing-more-than-1-word/#findComment-971835 Share on other sites More sharing options...
danp Posted December 5, 2009 Author Share Posted December 5, 2009 Worked a charm, thank you! The game is in shambles, I'm pretty sure it was an abandoned project too. Quote Link to comment https://forums.phpfreaks.com/topic/184046-phpsql-not-grabbing-more-than-1-word/#findComment-971938 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.