Category: PHP Frameworks
Moodle | This page should automatically redirect
In my plugin code I was trying to redirect from one page to another page using redirect as follows: redirect(“success.php?cd=”.$id); Redirecting to the other page was working but during redirection an intermediate page was being displayed like this: On click
HTML Media Capture
How to access Camera and upload the image/video to server? We can achieve above requirements easily by using HTML Media Capture : <form action=”upload.php” method=”post” enctype=”multipart/form-data”> Capture Image: <input type=”file” name=”uploadedfile” accept=”image/*” capture=”camera”> <input type=”submit” value=”Upload”> </form> To capture Audio
Moodle | How to create a scheduled task in moodle
In moodle we can create scheduled tasks which will run after a defined interval. We also have cron jobs in moodle but they usually run after every minute so if we need to run a task after a particular time
CakePHP 3.x or 2.x | Some important configuration settings
Some important settings that can help you while working with CakePHP 3 or 2. 1. How to set Homepage for your website in CakePHP 3? Go to the root directory of your project. You will see config folder there. Inside
Salesforce | Get list of Salesforce sobjects and fields in PHP
Problem: How to get list of all the Salesforce sobjects in php. Also get fields of each sobject. Solution: First we need to install Salesforce php toolkit for this. Once you have it then this is the sample code: require_once(SFDCPHPtoolkit
phpMyAdmin | Different methods to View Table Constraints
How to view List of constraints of tables of Database in phpMyAdmin There are various ways by which we can view the list of constraints applied to tables of given database in PhpMyadmin. Let’s see few methods here: Suppose we
Explanation of Column3 in Moodle/Totara
Column 3 layout in Moodle is basically dividing the screen into 3 parts . user setting options Layout (pre ) content layout (region) editing layout (post) user setting options Layout (pre): In column3 layout pre region is the first column.
Purpose of Security.salt and Security.cipherSeed in CakePHP
cipherSeed in CakePHP cipherSeed is used in Security::cipher() function to seed rand(). Seed means to give the initial value to rand() function to start and based on that the future values by rand() function are generated. In php, before 4.2.0
Heroku | The datasource configuration “default” was not found in database.php
Heroku throwing ERROR: “The datasource configuration “default” was not found in database.php” with database configuration already present for cakephp app. In one of our cakephp projects hosted on Heroku we used PostgreSql database. For configuring the database to connect to