could somebody look at this a tell me what is wrong

From: Date: Sun, 25 Aug 2002 02:26:50 +0000
Subject: could somebody look at this a tell me what is wrong
Groups: php.general 
Request: Send a blank email to php-general+get-114020@lists.php.net to get a copy of this message
Could somebody tell me way this is not working. It almost works but if there is more that one name to be selected it does not do it. Maybe there is an easier way to do this <?$file="c:/richard.com/autocontrol4/majordomo/www.testcompany1.com/lists/mylist"; $fp = fopen($file,"r"); while (!feof ($fp)) { $buffer = fgets($fp,4096); if(strstr($buffer,'@www.') === false){ $other[]= $buffer; }else{ $www[] = $buffer; }} fclose ($fp);?> <SELECT MULTIPLE NAME="userrecipients" SIZE="6"> <OPTION VALUE="">--- select local users from list ---</OPTION> <? $query="Select * from users where domname='$domname'"; $result = safe_query($query); while ($row = mysql_fetch_array($result)){ $name .= $row['username'] . ","; } //put all the database names into a array $dusername=explode(",",$name); for($i = 0; $i < count($www); $i++){$userwww =$www[$i]; //this will stripp the @domain.com off of the emall address $user_name=substr($userwww,0,strpos($userwww,'@')); //put all the names from the flatfile in to and array $fusername=explode(" ",$user_name);} foreach ($fusername as $fvalue){ foreach ($dusername as $dvalue){ //if the value in the flatfile is equal to value in database if ($fvalue==$dvalue){ //create option with selected if they equal ?> <option value="<?echo$fvalue?>" selected><?echo$fvalue?></option> <?}else{ //if not put it down hear ?> <OPTION VALUE="<?echo$dvalue?>"><?echo$dvalue?></OPTION> <?}}}?> </SELECT> -- Best regards, rdkurth mailto:rdkurth@starband.net

« previous php.general (#114020) next »