I have a dropdown list in a html form, i get the info for the dropdown list from mysql database using php, the problem is when i choose a name from the drop downlist and echo the name out i only get half the name if there is a gap in the name, eg if i get a name bart simpson it will only output bart and not show the last name, its something to do with the space in the name.
here is the code.
<form action='<?php echo $_SERVER['PHP_SELF']?>' method=post>
<select name='charity_name' id="charity_name">
<option <?php
//loop through categories table rows
while ($row=mysql_fetch_array($charity)){
echo "<option value=$row[charity_name]>$row[charity_name]";
}
?></option>
</select>
<input type=submit value="Go">
</form>
<?
$charity_name=$_POST['charity_name'];
?>
<?php echo $charity_name;?>
thanks paul