Can you help me please to make my script work?
I created additional Class with function inside - Second.class.php.
Then I add in the beginning of index.php:
// Instantiate second class
$secondclass = new Second();
Then I need to call a function out of the class, but with following conditions:
1. It can be called only when mp3 file is already decoded and placed in mp3 folder.
2. It has parameter $filename, where the $filename is obviously the name of the file (like 'Beatles_-_Let_it_be.mp3')
I tried to add it in the end:
As I thought that's how I can get filename.
And the function looks like this:
$filepath = $_SERVER['PHP_SELF'].parent::_SONGFILEDIR.$filename;
$ch = curl_init();
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => parent::_APIURL,
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => 'api_key='.parent::_APIKEY.'&url='.$filepath,
$output = curl_exec($ch);
Could you tell me what could be wrong with that?