Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/09/2011, 18:37
Avatar de dcreate
dcreate
 
Fecha de Ingreso: octubre-2009
Ubicación: Veracruz
Mensajes: 536
Antigüedad: 14 años, 6 meses
Puntos: 22
copiar de una base de datos con ton solo dar un click

hola a todos, disculpen tengo un pequeño programa que me muestra todos los datos que tengo en una tabla, el codigo es el siguiente

Código PHP:
<?php include "conexion.php";
conectar();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<style>
.letras
{
    border:#0000FF;
    color:#000033;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:12px;
    font-weight:bold;
}
.Estilo1 {
    font-size: 24pt;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.Estilo2 {
    font-size: 16px;
    font-weight: bold;
    font-family: "Courier New", Courier, monospace;
}
</style>
<body bgcolor="#87B3DE">
<p align="center" class="Estilo1">CLIENTES CON RFC EN BASE DE DATOS </p>
<form id="form1" name="form1" method="post" action="">
  <table width="804" border="0" align="center">
    <tr>
      <td width="230"><div align="right" class="Estilo2">BUSQUEDA POR NOMBRE: </div></td>
      <td width="564"><input name="buscar" type="text" id="buscar" size="80" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="bus" type="submit" id="bus" value="BUSCAR" /></td>
    </tr>
  </table>
</form>
<p>
  <?php
if(isset($_POST['bus']) && !empty($_POST['buscar'])){
$dato=$_POST['buscar'];
$bus=mysql_query("select *from cliente where nombre like '%$dato%'") or die ("error consultar: ".mysql_error());
$existess=mysql_num_rows($bus);
if(
$existess>0){
echo 
'<table border="2" align="center" class="letras">';
echo 
'<tr>';
echo 
'<td>NOMBRE</td><td>RFC</td><tr>';
while(
$con=mysql_fetch_array($bus)){
echo 
'<tr>';
echo 
'<td>'.strtoupper($con['nombre']).'</td><td>'.strtoupper($con['rfc']).'</td><tr>';
}
echo 
'</table>';
}else{
echo 
'no se encontro ninguna coincidencia';
}

}

$b=mysql_query("select *from cliente") or die("error al consultar rfc: ".mysql_error());
$existe=mysql_num_rows($b);
if(
$existe>0){
?>
</p><br />
<br />
<br />

<table width="682" border="2" align="center" class="letras">
  <tr>
    <td width="319">NOMBRE</td>
    <td width="234">RFC</td>
  </tr>
<?php while($c=mysql_fetch_array($b)){  
  echo 
'<tr>
    <td>'
.strtoupper($c['nombre']).'</td>
    <td>'
.strtoupper($c['rfc']).'</td>
  </tr>'
;
  }
?>
</table>
<?php }else{
echo 
'no existe ningun dato';

}
?>
</body>
</html>
hasta aqui todo esta perfecto, mi problema es que quiero saber si existe alguna manera para poder copiar al portapapeles con tan solo darle click a un texto generado de la tabla.

para darme un poquito a entender, mi tabla muestra:

nombre | rfc
jose luis perez jlp870409bte



quiero q solo al darle click al rfc me lo copie y lo guarde al portapapeles.espero me puedan ayudar, gracias
__________________
Somos lo que pensamos, como pensamos vivimos.