Category "php"

multiple PHPSESSID cookies and browser doesn't keep any

I'm getting 2 PHPSESSID set cookies headers from a login request from my yii application. Date: Thu, 05 Dec 2013 02:19:44 GMT Server: Apache/2.2.22 (Ubuntu) X

PHP date() with timezone?

So I've checked the list of supported time zones in PHP and I was wondering how could I include them in the date() function? Thanks! I don't want a default time

GuzzleHttp Hangs When Using Localhost

Here is a simple code snipplet but this just hangs and unresponsive. $httpClient = new GuzzleHttp\Client(); // version 6.x $headers = ['X-API-KEY' =&g

Select option from dropdown menu with PHP and mySql

I tried to create a simple select dropdown menu from MySQL database. However, it does not work on my code. Here is my code: <?php

Batch request Google Calendar php API

I'm working on a google Calendar sync with my application. I'm using the latest google-api-php-client Now I want to update all my event, so i want to use the

How to change the app environment at run time?

How can I change the app environment at run time? I have some classes that only bind in the service provider in production. I'd like to assert with a unit test

Twig - How to check if variable is a number / integer

How to check if variable is a number, integer or float? I can't find anything about this. Making project in Symfony 3.

Laravel 8: Array to string conversion while calling route:list

I have a resource controller which is ArticleController and I want to call this controller in web.php, so I coded: use App\Http\Controllers\Admin\PanelControlle

Batch request Google Calendar php API

I'm working on a google Calendar sync with my application. I'm using the latest google-api-php-client Now I want to update all my event, so i want to use the

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

I installed the Sonata admin bundle. After installation i refresh my page there is the cache problem then i use the following command to remove the cache: rm -

Popup Window and PHP form

I've created a contact page and a separate PHP page to receive the posted data. I'd like to make the PHP open in a popup window. I've tried methods online witho

How to get page number on dompdf PDF when using "view"

Ok, so I use the following snippet to get "views" of HTML with PHP variables loaded in as $data so that I can do things like fill in tr's of data from a databas

What is the best php library to convert html to plain text from email?

I have been testing 2 different PHP libraries (html2text & htmlpurifier) to convert html email to plain text. The problem is that none of them are formatti

WordPress Subquery returns more than 1 row on SELECT

I am executing this query with core cron by custom Wordpress plugin: // MAKE SQL CALL $SQL = "SELECT ".$wpdb->prefix."postmeta.post_id FROM ".$wpdb->

curl returning 301 error after migrating to https

We recently migrated to SSL, and the site works great with the exception of one function. The function uses curl in the code below to execute an api located on

Implementing route based models in Vue3 (Inertia.js)

I am following the following this guide, that shows how to enable "Route Based Modals" in Inertia.js. The post is written for Vue2, and I am using Vue3 - and I

admin-ajax.php - the server responded with a status of 500 (Internal Server Error)

I've drawn a complete blank with this if anyone can help. I have migrated a website from from a NGINX server to Apache. The installation works fine on NGINX but

CodeIgniter extend CI_URI undefined method

So I've been in the process of updating someones old CI 1 to CI 3 code. In process. In particular, the URI class extension is not working. I've read the CI doc

Sliders in Laravel

I am not able to show images in slider one by one, it displays all images at once. My static code is here and it works well with sliding images. <secti

Project structure for PHP

I am new to PHP and want to know the directory structure for the php projects. I have experience in Java and in java we have src contains java source files, WEB