Orionsbelter Posted May 15, 2008 Share Posted May 15, 2008 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 More sharing options...
DeanWhitehouse Posted May 15, 2008 Share Posted May 15, 2008 does this not limit it to two letters? AND status='2' Link to comment https://forums.phpfreaks.com/topic/105812-help-please/#findComment-542266 Share on other sites More sharing options...
MadTechie Posted May 15, 2008 Share Posted May 15, 2008 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 More sharing options...
Orionsbelter Posted May 15, 2008 Author Share Posted May 15, 2008 MadTechie your right put the two ' ' forgot too thanks Link to comment https://forums.phpfreaks.com/topic/105812-help-please/#findComment-542275 Share on other sites More sharing options...
MadTechie Posted May 15, 2008 Share Posted May 15, 2008 Solved? can you click solved please, saves other read this thread wanting to help Link to comment https://forums.phpfreaks.com/topic/105812-help-please/#findComment-542278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.