C:\xampp2_not used\htdocs\kptv\ro\inslastfive.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

$open 
fsockopen("sc4.streamingpulse.net","7222");
if (
$open) {
fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n");
$read fread($open,1000);
$text explode(",",$read);
$text substr($text[6], 0, -14);
//$text = substr($text[6],11, -14);
} else { $text="Nu pot afisa titlul piesei!"; }

$today date("Y-m-d H:i:s");
$db mysql_connect("localhost""kptv_site""yAct8WFaU5vpSU3e");
mysql_selectdb("kptv_site");

$la mysql_query("SELECT * FROM lastfive ORDER BY date DESC LIMIT 1");
$last mysql_fetch_row($la);

list(
$artist$title) = explode(" - "$text);

if ((
$last['0'] !== $artist) && ($last['1'] !== $title)){

$ins mysql_query("INSERT INTO lastfive VALUES ('".mysql_escape_string($artist)."', '".mysql_escape_string($title)."', '".$today."')");
$inssel mysql_fetch_row($ins);

$cou mysql_query("SELECT COUNT(*) FROM lastfive");
$count mysql_fetch_row($cou);

$integ intval($count[0]); 

if (
$integ >= 6) {
$rm mysql_query("DELETE FROM lastfive ORDER BY date ASC LIMIT 1");
$rem mysql_fetch_row($rm);
}
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586