<?php
$state = false;
if ($_POST['action'] == "add") { 
	$conexion = mysql_connect("localhost", "fulltono_relocos", "teamo147");
	mysql_select_db("fulltono_new2015", $conexion);
	
	$que = "INSERT INTO canciones (id, genero, artista, cancion, url, Hits) ";
	$que.= "VALUES ('".$_POST['id']."', '".$_POST['genero']."', '".$_POST['artista']."', '".$_POST['cancion']."', '".$_POST['url']."', '".$_POST['Hits']."') ";
	$res = mysql_query($que, $conexion) or die(mysql_error());
	$state = true;
}
?>
<!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>Agregar Tu Cancion Favorito solo en GooMusica.Com</title>
<style type="text/css">
<!--
body {
	font-family: "Trebuchet MS", Tahoma, Arial;
	font-size: 12px;
	color: #333333;
}
h2 {
	font-size: 16px;
	color: #CC0000;
}
input, select {
	font-family: "Trebuchet MS", Tahoma, Arial;
	font-size: 11px;
	color: #666666;
}
-->
</style>
</head>
<body>
<h2>Agrega Tu Cancion</h2>
<form id="insertar" name="insertar" method="post" action="">
  <p>id o Dejar en Blanco:
    <input name="id" type="text" id="id" size="50" />
  </p>
  <p>genero:
    <input name="genero" type="text" id="genero" size="50" />
  </p>
  <p>artista:
    <input name="artista" type="text" id="artista" size="50" />
  </p>
    <p>cancion:
    <input name="cancion" type="text" id="cancion" size="50" />
  </p>
    <p>url cancion:
    <input name="url" type="text" id="url" size="50" />
  </p>
    <p>Hits (valor recomendado 0):
    <input name="Hits" type="text" id="Hits" size="50" />
  </p>
  <input type="submit" name="Submit" value="Insertar Registro" />
  <input type="hidden" name="action" value="add" />
</form>
<?php if ($state) { ?>
<p><em>Cancion Agregada Correctamente</em></p>
<p>
  <?php } ?> 
</p>
<p>GooMusica - By Montalvo - 2017</p>
</body>
</html>
