Category: PHP Frameworks
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
CakePHP Security Component
CakePHP Security Component is very useful and provides an easy way to enable very tight security in our application: 1. It can restrict which HTTP methods our application accepts. 2. It provides Form Tampering Protection. 3. It can force to
Moodle | Add and access custom elements in Blocks
In Totara how to add custom HTML elements (checkboxes, input boxes etc) and then access the value selected by user on server side: 1. Adding custom elements. 2. Accessing values of custom elements. Each problem is discussed below: Overview: In Totara,
Shopify webhook getting fired multiple times and then getting deleted from shopify store
In our Shopify store we have an order creation webhook that points to a cakephp action URL. The action that webhook points to fetches the order data and then saves this to the database. The problem that we were facing
WordPress | Get title and description from posts dynamically
In wordpress we can get title from post title and description from post content area dynamically: <?php $id = get_the_ID(); //get the post id. $title = get_the_title($id); //get title from the post. $content = get_post_field(‘post_content’, $id);
Sorting Alphanumeric Data in PHP
While fetching data from database, in SQL query I had ‘order by’ clause but the results were not sorted when the data was in alphanumeric form. The reason for this is that SQL sorts character by character from left to
CakePHP | How to handle special characters (like apostrophes) in queries
Let us take an example: We have table employees with following fields: id int primary key, name varchar(50), city varchar(50) We have following records in the table: (1, isha, amr); (2, Hamlet’s, ghy); (3, éhjj, amr); 2nd and 3rd records
MySQL | Unable to create foreign key between two tables
We have two tables say table1 and table 2. In table 1, there is a field named Id and this field is set as primary key in table 1. We want to use it as foreign key in table 2.