Ver Mensaje Individual
  #4 (permalink)  
Antiguo 01/07/2011, 14:14
maxedrom
 
Fecha de Ingreso: mayo-2010
Mensajes: 13
Antigüedad: 13 años, 11 meses
Puntos: 0
Respuesta: Formulario con Agregados

Este es el codigo que tengo y quisiera ponerle un boton agregar para que se repitan los campos como explique arriba. Podrian darme una mano?

Cita:
<?php
if($_get[id]=="cancionesa"){

?>

<?php
$state = false;
if ($_post['action'] == "add") {

$que = query("insert into canciones (id, genero, artista, cancion, url, hits)values (null, '".$_post['genero']."', '".$_post['artista']."', '".$_post['cancion']."', '".$_post['url']."', '".$_post['hits']."') ");
$state = true;
}
?>
<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#000"><strong style="color:#ffffff">ingresar nueva canción</strong></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#000000">
<tr>
<td bgcolor="#d9e1e1"><form id="insertar" name="insertar" method="post" action="">
<p><strong style="padding-right:25px">genero:</strong>
<select name="genero" class="campolg">
<option value="">seleccione el género</option>
<?php
$query = query("select genero from generos order by genero");
while($g = mysql_fetch_array($query))
{ $_g = ucwords(limpiar($g["genero"]));
echo "<option value=\"$_g\">$_g</option>";
}
?>
</select>
</p>
<p><strong style="padding-right:30px">artista:</strong>
<input name="artista" type="text" id="nombre" size="50" class="campolg" />
</p>
<p><strong style="padding-right:25px">cancion:</strong>
<input name="cancion" type="text" id="fono" size="50" class="campolg" />
</p>
<p><strong style="padding-right:50px">url:</strong>
<input name="url" type="text" class="campolg" id="fono" value="" size="50" />
</p>
<p><strong style="padding-right:45px">hits:</strong>
<input name="hits" type="text" class="campolg" id="fono" value="0" size="50" />
</p><strong style="margin-left:12px">
<input type="submit" value="agregar cancion" style="background-color:#000; border:1px #000 solid; color:#ffffff" width="28" height="22" border="0" alt="" name="submit" /></strong>
<input type="hidden" name="action" value="add" />
</form>
<?php if ($state) { ?>
<script language='javascript'>alert('agregaste la musica a la web');</script>



<?php } ?> </td>
</tr>
</table>