Example #1
0
<?php

$name = trim($_POST["name"]);
$class = trim($_POST["type"]);
$singer = trim($_POST["singer"]);
$tag = trim($_POST["tag"]);
$url = strtolower($_POST["url"]);
$picurl = trim(strtolower($_POST["picurl"]));
$ip = $_SERVER["REMOTE_ADDR"];
$time = date("Y-m-d H:i:s");
/*
echo $name.$class.$tag.$url.$picurl.$ip.date("Y-m-d H:i:s");
*/
if ($name != "" && strpos($url, ".") == true && strlen($url) >= 5) {
    include "connection.php";
    $add = new SongData();
    if ($add->add_song($name, $class, $singer, $tag, $url, $picurl, $time, $ip) == true) {
        echo "Your song has been shared successfully! Thank you!";
    } else {
        echo "Sorry Fail to add your song!";
    }
    $add->close();
} else {
    echo "fail";
}
?>

Example #2
0
<?php 
session_start();
if (!isset($_SESSION["usuario"])) {
    header("Location: ../index.php");
}
$u_ip = $_SERVER["REMOTE_ADDR"];
require "connection.php";
$types = new SongData();
$classes = $types->get_classes();
$selections = "";
$type_list = "";
while ($row = mysql_fetch_array($classes)) {
    $selections .= "<option value='" . $row["c_id"] . "'>" . $row["c_name"] . "</option>";
    $type_list .= " <a style='color:gray' onclick=getList('type','" . $row["c_id"] . "','')  href='javascript:void(0);'>" . $row["c_name"] . "</a> | ";
}
$types->close();
?>
 
<html xml:lang="es" xmlns="http://www.w3.org/1999/xhtml" lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="Musica, mp3...">
<meta name="description" content="All-Muzik Pistas Musicales">
<meta name="author" content="Salvador Aguilar Villaseñor.">
<meta name="COPYRIGHT" content="ceneval.edu.mx">
<title>Pistas</title>
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type='text/javascript' src='jquery/jquery.simplemodal.js'></script>
<script type="text/javascript" src="js/default.js"></script>
<!-- Contact Form CSS files -->
<link type='text/css' href='css/basic.css' rel='stylesheet' media='screen' />
Example #3
0
<?php

require "connection.php";
$gurl = new SongData();
$id = trim($_GET["sid"]);
if (is_numeric($id) == true) {
    $gurl->add_playtimes($id);
    echo $gurl->getSongById($id);
    $gurl->close();
} else {
    echo "illegal opreation";
}
Example #4
0
<?php 
require "connection.php";
$order = trim($_GET["by"]);
$type = trim($_GET["type"]);
$page = trim($_GET["page"]);
if ($page <= 0 || is_numeric($page) == false) {
    $page = 1;
}
$data = new SongData();
$sql = "select * from songs";
switch ($order) {
    case "time":
        $sql .= " order by s_id desc";
        break;
    case "type":
        if (is_numeric($type) == true) {
            $sql .= " where s_class=" . $type . " order by s_id desc";
        }
        break;
    case "popular":
        $sql .= " order by s_playtimes desc";
        break;
    default:
        $sql .= " order by s_id desc";
        break;
}
$allsongs = $data->excute($sql);
$item = "";
$pcode = "";
$pagesize = 35;
Example #5
0
<?php

require "connection.php";
$id = trim($_GET["sid"]);
if (is_numeric($id) == true) {
    $cp = new SongData();
    if ($cp->add_cantplay($id)) {
        echo "success";
    } else {
        echo "fail";
    }
    $cp->close();
}