Jump to content

delirious1230

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

delirious1230's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey everyone, i am trying to get id3 tags (informations that are stored in mp3 file: playtime,bitrate,size,album,year etc) of mp3 files from remote servers. Code is originaly by getid3.com and its currently made for local files. Here you can see code: <?php require_once('getid3/getid3.php'); $getID3 = new getID3; $filename = "http://website.com/subfolder/eminem_-_toy_soldier.mp3"; $ThisFileInfo = $getID3->analyze($filename); getid3_lib::CopyTagsToComments($ThisFileInfo); echo @$ThisFileInfo['playtime_string']; ?> In this code with remote url of the mp3 file i get no details, but if i insert in that line $filename = "/subfolder/eminem_-_toy_soldier.mp3"; << that file is hosted on same server where the code is, than it works I have attached archive of files that are needed for running the script. Thanks for all the help you can provide.... if you need more explanation ask and i'll try to give more details. [attachment deleted by admin]
  2. I have problem with filesize 0 of file i want to download... i got script that direct downloads etc ... and than i have htacces file that check user how much he downloaded yet, i think i have all headers for download included, but dont know what would be wrong, if anyone can help me with this, please do ... here is file htacces: IndexIgnore */* RewriteEngine on RewriteRule (.*)(ace|avi|bin|bmp|doc|exe|gif|iso|jpg|mid|mp3|mpg|pdf|png|ppt|rar|txt|ttf|wav|xls|zip)$ /downloads/download.php?file= [QSA] downloader.php <? require "../include/down.php"; // Get File Name, IP Address Today's Date $file = $_GET['file']; $ip = addslashes($_SERVER['REMOTE_ADDR']); $todaysdate = date("Y-m-d"); if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } //////////////////////////////////////// if(isset($_GET['file'])){ // SETTING MY OWN VARIABLES include("sets.php"); //$filex = filesize($file); //$path = addslashes($_SERVER['REQUEST_URI']); // DB connect $con = mysql_connect($hostName, $userName, $password); mysql_select_db($databaseName,$con); // Retrieve data $query = "SELECT ipaddress,lastaccess,download,filepath FROM download WHERE ipaddress='".$ip."' AND lastaccess='".$todaysdate."'"; $result = mysql_query($query,$con)or die(mysql_error()); if(is_resource($result)) { // CHECK FOR MAXDOWNLOADS if(mysql_num_rows($result)>=1){ $data = mysql_fetch_assoc($result); if($data['download']>=$max_downloads) { header( 'Location: ../limited.php' ) ; } else { @mysql_query("UPDATE download SET filepath='".$data['filepath'].",".$file."' ,download=".($data['download']+1)); downLoadFile($file); } } else { // If no results, input new IP & DATE @mysql_query("INSERT INTO download (ipaddress,lastaccess,download,filepath) VALUES('".$ip."','".$todaysdate."',1,'".$file."')"); downLoadFile($file); } } else { echo "<b>No resource</b>"; } // store the record into $row } else { echo "<b>You dont have permmision to download file!</b>"; } function downLoadFile($file){ header("Cache-control: private"); header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=$file"); header("Content-length:".filesize($file).""); header("Content-Type: application/zip"); header("Content-Transfer-Encoding: binary"); readfile($file); header($headerStr); } ?> I hope i told good enough, thanks in advance...
  3. Currently what i have in dl.php <?php // change this value below $cs_conn = mysql_connect('localhost', '****', '****'); mysql_select_db('*****', $cs_conn); $lol = $_GET[file]; $max_downloads = '10'; $ip = addslashes($_SERVER['REMOTE_ADDR']); $todaysdate = date("d-m-Y"); $filex = filesize($lol); $path = addslashes($_SERVER['REQUEST_URI']); // Retrieve all data $query1 = mysql_query("SELECT * FROM downloaded WHERE `IP`='$ip' AND `DATE`='$todaysdate' AND `EXEMPT`='$exempt AND `downloaded`='$downloaded''") or die(mysql_error()); $data=mysql_fetch_array($query1); if(mysql_num_rows($query1) < $max_downloads){ mysql_query("INSERT INTO downloaded (`IP`, `DATE`, `DOWNLOADED`, `EXEMPT`) VALUES('$ip','$todaysdate','','0') ") or die(mysql_error()); echo 'no previous data - data now inputted'; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); header("Content-Disposition: attachment; filename=".basename($lol).";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($lol)); @readfile($row['FileName']); exit(0); }else{ // Do Nothing & carry on } // Calculate total downloads $total = $data[DOWNLOADED] + $filex; if ( $total >= $max_downloads ) { // This file will take them over their limit echo 'Run out of downloads & not EXEMPT - no download for you!'; // REDIRECT TO INFO PAGE } else { header('Content-type: application/octet-stream'); header('Content-Disposition: filename="'.$lol.'"'); header('Content-length: '.$lol); header('Cache-control: private'); // REDIRECT TO DOWNLOAD } ?> and htacces RewriteEngine on RewriteRule (.*)(ace|avi|bin|bmp|doc|exe|gif|iso|jpg|mid|mp3|mpg|pdf|png|ppt|rar|txt|ttf|wav|xls|zip)$ /downloads/dl.php [QSA] and sqlbase code CREATE TABLE `downloaded` ( `DATE` datetime NOT NULL, `DOWNLOADED` varchar(120) NOT NULL, `EXEMPT` varchar(120) NOT NULL, `ip` varchar(15) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; script is working in half way every time i download file it write this in database... I would like that every time that something is downloaded that update field downloaded or exempt... and that date would be correct...
  4. Ok now its okay, is it possible to contact over MSN, there is still something to fix ???
  5. now i get Unknown column 'IP' in 'where clause' ...... i knew that ip must be in sql.... Maybe you got MSN or something that we can talk a lil bit faster ?
  6. I deleted filepath but its still same :S Duplicate entry '127.0.0.1' for key 1
  7. none asked for his SQL password -.- i asked for code like that (CREATE TABLE `downloaded` ( `filepath` varchar(255) NOT NULL, `IP` varchar(15) NOT NULL,.............) he has different one... original one. I just modified it but it might be incorrect :S
  8. Hmmm this is my current database... CREATE TABLE `downloaded` ( `filepath` varchar(255) NOT NULL, `IP` varchar(15) NOT NULL, `DATE` datetime NOT NULL, `DOWNLOADED` varchar(120) NOT NULL, `EXEMPT` varchar(120) NOT NULL, UNIQUE KEY `filepath` (`filepath`,`IP`), KEY `ipadres` (`IP`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; i have it under unique yes.... but i thought that is correct....
  9. I get this: Duplicate entry '127.0.0.1' for key 1 what is wrong And second in previous post i meant sql code for phpmyadmin ... that is needed for script
  10. Yeah that needed apulmca2k4, i wanted to get his sql code than i would need that part too i gues
  11. Apul i added you on MSN can u accept me and we can solve problem?!
  12. Possible to add sql code for this script??? Please
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.