Jump to content

Recommended Posts

I have a drop downmenu where as a user selects another user's name, for example i want to look at MR. MAN  but when it is submit it only comes up as MR. it stops at a space why?

 

here is the code for it:

$username=$_POST['username'];
<select name="kill_username" class="entryfield" id="kill_username">
              <option selected="selected"></option>
              <?php $get=mysql_query("SELECT * FROM search WHERE username='$username' AND status='2'");
while($it=mysql_fetch_object($get)){


echo "<option value=$it->target>$it->target</option>";
}
?>
            </select>

 

Link to comment
https://forums.phpfreaks.com/topic/105812-help-please/
Share on other sites

change

echo "<option value=$it->target>$it->target</option>";

to

echo "<option value='$it->target'>$it->target</option>";

 

Note the quotes

 

EDIT:

without the quotes its values is the test until with a > or a space is hit, with the quotes it takes the value until the closing quote is hit

Link to comment
https://forums.phpfreaks.com/topic/105812-help-please/#findComment-542267
Share on other sites

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.