Skip to content

Tag: php

Contact Form, sending an email is just downloading my PHP file

I’m having a weird error that I cannot figure out with a PHP file, I’ve never touched PHP and I am trying to use it to send a Name, Email Address, and a message back to me from a website, but for some reason, the code I wrote is just downloading the PHP file instead, can anyone else see where

Google Classroom – Create Course Error PHP

I’m trying to create a course using the Google_Service_Classroom API, using PHP, but I get an error in the call. My return: I’m seeing the documents, but I don’t see where to fix this problem. Answer The error message is self-explanatory. It says Argument 1 passed to Google_Service_Classroom…

Cant echo anything after cURL in PHP

I have a curl that works fine. The file where the cURL is placed is a PHP file, executed by .ajax I am echoing an $apikey at the end of the PHP file, without the cURL script. it prints correctly. …

pg_insert(): Accepts only string key for values

I’ve got postgres table with an auto-incremental column, and attempting to insert data from PHP with pg_insert returns a string key error. How would I go about modifying this for the different datatypes? Currently returns the following error: A var_dump returns: My Postgres table is made up of: Answer F…

How to change dateformat on Yii platform?

I am new to the Yii platform, and I am wondering how to change the dateformat. It’s currently in the American date format that is YYYY-MM-DD. I want it to be DD-MM-YYYY. Is there any way to this? Answer config file add in ‘components’ => [] You can add it and edit it to your style.

Importing large number of pdfs into mPDF is causing /fopen to fail

Edit: Updated after assistance from Jan Edit: The code dos not fail until $mpdf->Output($max . ‘ imports .pdf’, ‘D’); is called PHP Version 7.1 MPDF Version 8.0.10 Setasign fpdi_pdf-parser Version 2.0.4 Error Failed to open file (fopen) Compnay Induction (checklist) th v2.pdf Failed…

Is it good pratice to add closure inside constructor?

I have added closure inside the constructor and unsure of its performance as well as best practice. What is the best way to do that if it is not the right way to do it? Answer I have an own array class with a lot of functions (or closures) defined in the constructor. This type of definition of functions also

Counting entries in sub/subarray

I am working on a chat. I have an array that contains the info regarding the room (in the example below, 2 rooms (the lounge, the beach)). I have an issue when I have an empty room (in the example the beach), as it contains by default no user, (which is a Null user). I am trying to count, in