version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
networks:
- proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
proxy:
driver: bridge
# вне этого docker-compose.yml сеть будет доступна по имени {директория}_proxy, в моём случае это nginx_proxy
# ...
services:
# Web server
web:
image: nginx
environment:
- 'VIRTUAL_HOST=${NGINX_HOST}' # подтягиваем из конфигурации окружения (.env, NGINX_HOST=api.local)
networks:
nginx_proxy: # чтобы наш хостовый nginx мог достучаться по общей с прокси сети до других контейнеров в той же сети
aliases:
- ${NGINX_HOST} # указываем алиас, по которому будет доступен контейнер, в моём случае это локальный хост api.local
default: # дефолтная сеть, чтобы не ломать связь внутри текущей Docker Compose конфигурации
# PHP
php:
image: php
networks:
- nginx_proxy # возможность из PHP иметь доступ к общей прокси сети, чтобы взаимодействовать с другими хостами
- default
networks:
nginx_proxy: # возьмём сеть извне
external: true
http://api.local/
')). foreach (($table_header->children) as $num => $th_row) {
// echo "FIRST foreach<br>";
//var_dump($th_row->plaintext);
//var_dump($num);
switch(trim($th_row->plaintext)){
case 'Наименование':
// case 'Наименование светильника':
$numer["name"] = $num;
break;
case 'Фото':
case 'Изображение':
$numer['image'] = $num;
break;
case 'Артикул':
$numer['model'] = $num;
break;
}
}
foreach ($arr_of_tl as $num => $value) {...}
echo json_encode($times);
jQuery.ajax({
type: "POST",
url: "/function/checkTime.php",
data: ({date:date}),
dataType:"text",
success: function(data) {
console.log(data);
}
});
{"0":"1","id":"1","1":"2014-05-24","date":"2014-05-24","2":"16:00","time_start":"16:00","3":"17:00","time_end":"17:00"}
....
public function dbConnect() {
...
...
return $db;
}
}
$db = $testConnect->dbConnect();
$sql = $db->query('SELECT name FROM qwert');
print_r($sql);
mysqli_result Object ( [current_field] => 0 [field_count] => 1 [lengths] => [num_rows] => 1 [type] => 0 )
<?php if (isset($_GET['add-entry'])): ?>
<br />
<center>
<form method="POST" action ="/admin/admin.php";
<label>Название</label>
<input type="text" name="name"><br />
<label>Юридическое название</label>
<input type="text" name="ur_name"><br />
<label>Дата запуска проекта</label>
<input type="date" name="startdate"><br />
<label>Общий приход</label>
<input type="text" name="globalinput"><br />
<label>Общий расход</label>
<input type="text" name="globaloutput"><br />
<input type="submit" name="submit" value="Добавить"><br />
</form>
</center>
<?php endif ?>
<?php
if ($_POST['submit']==true) {
$name = $_POST['name'];
$ur_name= $_POST['ur_name'];
$startdate = $_POST['startdate'];
$globalinput = $_POST['globalinput'];
$globaloutput = $_POST['globaloutput'];
$mysqli->query("INSERT INTO projects VALUES(0,'$name','$ur_name','$startdate','$globalinput','$globaloutput')") or die ("Your bunny wrote, ne dobavlyaet! >_<");
}
?>
?php
$name=$_POST['name'];
$score=$_POST['score'];
$uploads_dir = '/images';
$tmp_name = $_FILES["screenshot"]["tmp_name"];
$name = $_FILES["screenshot"]["name"];
move_uploaded_file($tmp_name, "$uploads_dir/$name");
if ($_POST['submit']==true) {
$mysqli->query("INSERT INTO guitar VALUES(0, NOW(), '$name', '$score', '$pic')");
}
?>
Warning: move_uploaded_file(/images/WIN_20131204_232139.JPG) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\srv\OpenServer\domains\localhost\tmp\addscore.php on line 35
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'H:\php49F4.tmp' to '/images/WIN_20131204_232139.JPG' in C:\srv\OpenServer\domains\localhost\tmp\addscore.php on line 35
Warning: move_uploaded_file(C:/srv/OpenServer/domains/localhost/images/) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\srv\OpenServer\domains\localhost\tmp\addscore.php on line 29
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'H:\phpABBE.tmp' to 'C:/srv/OpenServer/domains/localhost/images/' in C:\srv\OpenServer\domains\localhost\tmp\addscore.php on line 29
Array ( [screenshot] => Array ( [name] => WIN_20131201_052047.JPG [type] => image/jpeg [tmp_name] => H:\phpB65.tmp [error] => 0 [size] => 122294 ) )
<?php
define('GW_UPLOADPATH', 'images/');
$name=$_POST['name'];
$score=$_POST['score'];
$pic = $_FILES['screenshot'];
$pic=move_uploaded_file($_FILES['screenshot'], GW_UPLOADPATH);
?>
bool(false)