lo siento pero no he podido cumplir lo que dije antes, siento volver a molestarte jejej.
me he topado con un pequeño problema y es que a la hora de buscar los usuarios para agregarlos tambien me da la posibilidad de agregar a los que ya tengo y eso querría evitarlo.
alguna idea de como hacerlo??
este es el código:
Código PHP:
$busca=@$_POST['nombre'];
mysql_connect("localhost","root","");
mysql_select_db("logueo");
if($busca!=""){
$busqueda=mysql_query("SELECT * FROM usuarios WHERE usuario LIKE '%".$busca."%' AND usuario != '".$_SESSION['k_username']."'");
while($f=mysql_fetch_array($busqueda)){
$id=$f['id'];
$foto=$f['foto'];
$nombre=$f['usuario'];
?>
<form action="agregar.php" method="post">
<input name="id" type="hidden" value="<?php echo $id;?>" />
<table width="100%" height="1" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000033" bgcolor="#5F92B9">
<tr>
<td width="11%" height="1"><div align="center">
<span class="Estilo8"><?php echo"<img src='$foto' width='100'/>";?></span>
</div></td>
<td width="37%" height="1">
<div align="left">
<?php
echo''.$nombre.'';?>
</div></td>
<td width="44%"><div align="center">
<label>
<textarea name="mensaje" cols="50" rows="3" id="textfield" onFocus="this.value=''">mensaje...</textarea>
</label>
</div></td>
<td width="8%"><div align="center"><input name="agregar" type="submit" value="agregar" />
</div></td>
</tr>
</table></form>
<?php
}
}
?>