Jump to content

Recommended Posts

:facepalm: 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]

Link to comment
https://forums.phpfreaks.com/topic/184046-phpsql-not-grabbing-more-than-1-word/
Share on other sites

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.)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.