<Directory /var/www/>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
php artisan cache:clear
php artisan route:clear
composer dump
$(document).on('click', function(event) {
var $target = $(event.target);
var $clickedForm = $target.closest('form').length > 0 ? $target.closest('form') : null;
if ($clickedForm)
$('form').not($clickedForm).remove();
else
$('form').remove();
});
$(document).on('click', function(event) {
var $target = $(event.target);
var $clickedForm = $target.closest('form').length > 0 ? $target.closest('form') : null;
if ($clickedForm)
$('form').not($clickedForm).find('input[type="submit"]').remove();
else
$('form').find('input[type="submit"]').remove();
});
.logo a:hover #halfcircle1 {
-webkit-animation: animatelogo1 .5s ease infinite;
animation: animatelogo1 .5s ease infinite;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
transform-origin: 50% 50%;
}
<input type="checkbox" class="svois" value="7"><label> Высота</label>
<input type="checkbox" class="svois" value="8"><label> Количество</label>
<input type="checkbox" class="svois" value="9"><label> Назначение</label>
<input type="checkbox" class="svois" value="10"><label> Способ изготовления, метод производства</label>
<input type="checkbox" class="svois" value="11"><label> Диаметр</label>
<input type="checkbox" class="svois" value="12"><label> Вид обработки</label>
<input type="checkbox" class="svois" value="13"><label> Тип покрытия</label>
<input type="checkbox" class="svois" value="14"><label> Форма</label>
<script>
var tagsArray = [];
$(".svois:checked").each(function(index) {
tagsArray.push($(this).val());
});
$.ajax({
type: "POST",
url: "ajax1.php",
data: {"svois": tagsArray},
success: function(onecat5){
$('#onecat5').html(onecat5);
}
});
</script>
abstract class Model extends BaseModel
{
/**
* @return string
*/
public static function table()
{
return with(new static)->table;
}
/**
* Insert each item as a row. Does not generate events.
*
* @param array $items
*
* @return bool
*/
public static function insertAll(array $items)
{
$now = \Carbon\Carbon::now();
$items = collect($items)->map(function (array $data) use ($now) {
return array_merge([
'created_at' => $now,
'updated_at' => $now,
], $data);
})->all();
return \DB::table(static::table())->insert($items);
}
}
sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql \
/var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
exit
rm ~/.mysql_history
sudo find / -name .mysql_history -delete
$rules = [
// тут правила для всех полей кроме картинок
];
$validator = Validator::make($request->all(), $rules);
$validator->each('images', ['required', 'mimes:png,jpg,jpeg,gif,svg']);
if ($validator->fails()) {
// ...
}
namespace AppHttpRequests;
use AppHttpRequestsRequest;
class ImagesRequest extends Request {
public function authorize()
{
return true; // если гости тоже могут загружать картинки то false
}
public function rules()
{
return [
// тут правила для всех полей кроме картинок
];
foreach($this->request->file('images') as $key => $val)
{
$rules['image.'.$key] = 'required|mimes:png,jpg,jpeg,gif,svg';
}
return $rules;
}
}
public function store(App\Http\Requests\ImagesRequest $request)
{
// ...
}
namespace App\View\Composers;
use App\Comment;
use App\Blog;
use Illuminate\View\View;
class AddStatistic
{
public function compose(View $view)
{
$statistic = [
'last_comments' => Comment::getLast(),
'top_rated' => Blog::topRated(),
];
$view->with('statistic', $statistic);
}
}
namespace App\Providers;
use App\View\Composers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
...
$this->app['view']->composer(['partials.statistic'], Composers\AddStatistic::class);
}
...
}
$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);
<script src="js/canvas-to-blob.min.js"></script>
canvas.toBlob(function(blob) {
saveAs(blob, "image.png");
}, "image/png");
$base64string = $_POST['base64string'];
$data = base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $base64string));
file_put_contents('image.png', $data);