Category "php"

Saving Data from form to database using AngularJS and php

I'm pretty new in angular. i created a modal window to user share story and after that show it in body: html <button class="btn btn-primary new-story" n

Download & Save Zoom Recording in directory by PHP

Some time ago this code was working fine. I was able to download a file into a directory by using a copy command but it stopped working. It is no longer downloa

oauth-private.key does not exist or is not readable

So, I imported another project from Bitbucket and tried to launch it using php artisan serve, I always get this error: [LogicException]

uncompressing xml feed gzip deflate php

I am being sent an XML feed which needs to be downloaded in a 'compressed way'. The example I have been given is this: $url = 'http://myurl.com'; $headers[] =

Why is this PHP array not the same?

I'm not understanding why the array: <? $data = array( 'items[0][type]' => 'screenprint'); ?> Is not the same as <? echo $data['items'][0]['typ

mysql_result is defined but mysql_free_result warns it expected a resource

This code tests to see if there was a result before freeing it up: $result = mysql_query($query) or die("$query\n\n" . mysql_error()); $id = mysql_insert_id();

Laravel: Create morphs() relationship nullable

I want to create a one-to-one polymorphic relation allow null relation. Example: Schema::create('ps_assistances', function (Blueprint $table) {

How to set dynamic `home` and `siteurl` in WordPress?

I config the multi-language setting dynamically using the locale filter. Which fetch the sub-domain name to determine the language. function load_custom_langua

WooCommerce "Error processing checkout. Please try again". How do I get more details?

I am writing (actually modifying an existing one) gift card plugin. During checkout, the gift cards are created on a different system through a Web JSON API.

Adding multiple items to WooCommerce cart at once

I have 3 IDs of the different items that I want to add to my shopping cart. I could use https://url.com/shop/cart/?add-to-cart=3001 but when I want to add 3 ite

Doctrine2 Criteria convert 1 to TRUE

I've got a problem with Criteria from Doctrine2. Iusing Criteria to check a SMALLINT type in PostreSQL like this : $criteria = Criteria::create()->where(Crit

How to redirect to another page after n seconds in wordpress without using javascript?

Following problem: I check a condition for a plugins' page in php and if it's false I want to redirect to another page. With PHP it would simply be: header('

Is it possible to use session from kernel console command in laravel?

I'm trying to fetch data from sessions when I run a command in my console, but session always returns an empty array! php artisan command:mycommand Below is

Apply session id from request header

I am not sure if this is possible in Symfony so I came up with a question. The high-level scenario is: A request on the API (built in Symfony) must return the

unable to load your default controller on Codeigniter

This is the error that i am getting. Please make sure the controller specified in your Routes.php file is valid. Let me explain this. In my application i

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

I would like to take an array like this and combine it into 1 single array. array (size=2) 0 => array (size=10) 0 => string '1'

Using underscore before public function names

I was just reading some code and I came across a function named __toString. Here is the function prototype: public function __construct($par) What is the reaso

Parameter is not sent to Laravel route in Ajax

I'm working with Laravel 5.8 and I wanted to apply a discount code system for my site. So I tried sending data with Ajax like this: $.ajax({ type: 'POST',

Read users and passwords from a txt file

I have a txt file which looks like this USER: user46226234 PASS: #)(HF(WE*FHWE USER: user49503420594 PASS: yellowbird USER: user449202934 PASS: dog I'm trying

How to prevent phpmailer sending embedded image as an attachment on Gmail?

I am sending an email with the logo of a company in it. However, I find it annoying when it shows the .png file on the list of emails on Gmail. Upon clicking th