Jump to content

Help please


Orionsbelter

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.