$target = 'http://mp3-server.ru/accept.php';
$file_path = realpath('/путь/к/файлу/filename.mp3');
$post = array('name1' => '111', 'name2' => '222', 'file'=> '@'.$file_path);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result=curl_exec ($ch);
curl_close ($ch);
echo $result;
$uploaddir = realpath('./') . 'uploads/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
echo "Файл успешно загружен в папку $uploaddir \n";
} else {
echo "Не удалось получить файл \n";
}
echo 'Информация о принятых данных';
print_r($_FILES);
echo "<hr>";
print_r($_POST);
// 1. Скопировать SxGeo.php и SxGeoCity.dat (или другие базы) на сервер
// 2. Подключить файл SxGeo.php в свой скрипт, добавив строку
include("SxGeo.php");
// 3. Создать объект SxGeo
// $SxGeo = new SxGeo(); // Режим по умолчанию, файл бд SxGeo.dat
$SxGeo = new SxGeo('SxGeoCity.dat', SXGEO_BATCH | SXGEO_MEMORY); // Самый быстрый режим
// 4. Определяем город (SxGeo City, GeoLite City, IpGeoBase)
$SxGeo->get($ip); // возвращает информацию о городе, без названия региона и временной зоны
// $SxGeo->getCityFull($ip); (возвращает полную информацию о городе и регионе)
$a = exec('"ffmpeg" -y -i "path_to_video" -ab 128k -s 640x480 -vcodec mpeg4 -acodec:a copy "output.mp4" 2>&1 ', $output, $error);
$ffmpeg = FFMpeg\FFMpeg::create();
$audio = $ffmpeg->open('track.mp3');
$format = new FFMpeg\Format\Audio\Flac();
$format->on('progress', function ($audio, $format, $percentage) {
echo "$percentage % transcoded";
});
$format
-> setAudioChannels(2)
-> setAudioKiloBitrate(256);
$audio->save($format, 'track.flac');
public function __construct(Guard $auth, Registrar $registrar)
{
$this->auth = $auth;
$this->registrar = $registrar;
}
$this->registrar->create($request->all());
должен работать отдельно$context = stream_context_create(array("http"=>array(
"method" => "GET",
"header" => "Accept: text/*, */*\r\n",
"ignore_errors" => true,
)));
$page = file_get_contents("https://instagram.com/accounts/login/", false, $context);
extension=php_openssl.dll
allow_url_include = On
$('#addItem').on('click', function(event) {
var cartItems = $.session.get('cartItems');
if (!cartItems) cartItems = [];
var newItem = getNewItem();
cartItems.push(newItem);
$.session.set('cartItems', cartItems);
});
jQuery(document).ready(function($) {
var cartItems = $.session.get('cartItems');
if (!cartItems) cartItems = [];
console.log(cartItems);
});