Category "php"

Having trouble with PDO queries (Notice: Undefined index)

I'm trying to extract a data from database, I'm using PDO to do it. I have the following PHP code without success: public function CheckIdentity($email, $passwo

Failed user login on production server using Symfony framework (Authentication request could not be processed due to...)

I'm using Symfony for a project and I have been trying to get the login to work on production server with no success for the past 2 days. I keep getting the err

Handling expired token in Laravel

What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the pa

Laravel relationship belongsToMany with composite primary keys

I have 3 tables and I'm trying to make relations between order_products and order_products_status_names. I have transition/pivot table named order_product_statu

Facebook API, get page post link (PHP)

Here's some code: $facebookUrl = 'https://graph.facebook.com/'.$facebookPageId.'/posts?&access_token='.$facebookAppId.'|'.$facebookAppSecret; $facebookData

WHERE IN array binding in DB::raw laravel 5.4

I'm trying to bind an array in a raw WHERE IN query in the Laravel DB example: $arr = [1,2,3]; DB::select(DB::raw("select * from test1 WHERE id IN ? "), [$arr

How does this Facade works

I'm working with Laravel 5.8 and it's an Online Store project written by other programmers. Basically I have faced something weird that never seen before. Let's

Converting IPv6 to IPv4 address in PHP

I need to convert IPv6 addresses to IPv4 addresses. To do this, I used code from pedmillon's answer to a related question: $ipv6 = $_SERVER['REMOTE_ADDR']; $ip

Problems getting instance of UploadedFile in Yii2

I tried to upload a file to a server using UploadedFile class, but I can't get an Instance. In my Model: public $arch; public function rules() { return [[[

How to use PHPCBF to fix one issue at a time?

I've added a PHPCS configuration to get some standards into a legacy project. I'm using a relaxed version of PSR-2 as an interim step. Now what I want to do, i

WAMP Virtual Host not working

I am using a wamp version 2.5 My Apache is 2.4.9 PHP: 5.5.12 MySQL: 5.6.17 I have these configurations: On my httpd.conf # Virtual hosts Include conf/extra/h

Non Receipt of the email sent by XAMPP Mercury Server with Gmail SMTP Settings at Local Host

I have setup the php.ini and sendmail.ini with smtp.gmail.com with my gmail ID and password with my xampp folder on local computer. The message is successfully

How to update array value in Laravel

My controller code: $userBasicInfoId = $this->userBasicInfo->where('user_id', $userProfile['id'])->value('id'); if($userBasicInfoId) {

file_put_content...fail to open stream:Permission denied in Laravel 5

The error is mention in below:- ErrorException in Filesystem.php line 81: file_put_contents(/var/www/html/Training-management-system/storage/framework/views

Font family issue in dompdf

I'm using DOMPDF v0.8.0 I'm having a problem with this library. I'm using this dompdf library with codeigniter2. I need to implement digital signature and co

How to show a popup modal in codeIgniter?

I have written a javascript click function to a class to display a popup when the relevant class be clicked. When i just put an alert it gives me the correct ou

How do I do HTTP basic authentication using Guzzle?

I want to do basic access authentication using Guzzle and I am very new to programming. I have no clue what to do. I tried to do this using curl but my environm

Filter array by skipping every nth element from the end

Is there an efficient way to get an array by skipping every n elements starting from the end (so that the last element is always in the result)? Basically, I ha

PHP DOTENV unable to load env vars

I'm using php dotenv for env vars for my php application. The readme says I can load php dotenv into my application with: $dotenv = new Dotenv\Dotenv(__DIR__

php artisan queue:flush does not flush the queues

Our log is blowing up due to non-stop retries by the queue workers despite having the retries set to 1 only. This is literally caused by 3 different failed job