CakePHP 4 - Impersonate Another User
This article demonstrates how to login as another user by impersonation, in CakePHP4. This allows administrators to login as another user and test issues with that user.
This article demonstrates how to login as another user by impersonation, in CakePHP4. This allows administrators to login as another user and test issues with that user.
This example shows you how to create a form, the javascript, and the php to handle resizing images before posting to the php file, which saves the original and resized base-64 standard form fields generated.
Search and filter records in a table using jQuery.
These examples describe how to install the AWS SDK for PHP with composer, and utilize S3.
Use an alternative prefix in CakePHP4. For example, you can have separate folders for different functionality by user role, and you can use this method to separate functionality (actions / methods) for specific purposes, in separate controllers.
If you have been using GMail's "less secure" feature to send SMTP emails from your website, you've probably noticed as of May 30, 2022 that it's no longer working. here's a solution.
This example shows you how to encrypt a string and decrypt it.
Masking Text Effect in Photoshop
This article shows you how to easily blur parts of an image in Photoshop.
This guide will walk you through the process of setting up three Model Context Protocol (MCP) servers for Claude Desktop: SQLite, GitHub, and filesystem access. These servers enable Claude Desktop to interact with your local files, databases, and GitHub repositories.
Quickly create/route an email address / "alias" without eating up the user's email aliases (30 allowed). Since I have multiple domains, aliases can add up quick and hit that 30-alias limit. The solution is to create a new default route.
This article explains how to add a private subfolder in your public AWS S3 bucket.
This example shows you how to add HTML to your flash messages. Helpful when you want to add a link in CakePHP flash messages.
This describes how to clear your cache for a website to address the Missing or invalid CSRF cookie issue.
How to Fix Error: CSRF token from either the request body or request headers did not match or is missing.
Override the CakePHP maximum of 100 records in pagination.
This example demonstrates how to return the first row or record from those returned in CakePHP.
This example shows you how to obtain user information from the session.
This example shows you an example bucket policy which limits requests to those made from specific IP addresses.
This article shows you how to change the new (2022) settings in Chrome browser, so it throws away some of it's cache after shorter periods. This results in your Chrome browser being lighter an consumes less memory.
This article shows you how to create a virtual host in WAMP's Apache server on Windows.
This example shows you how to skip CSRF checks in CakePHP (when you have it globally enabled), for prefixes with 'Api'
This example shows how you can get the current routing prefix in CakePHP.
This example shows you how to reference another component from within a separate component in CakePHP 4. For example, you can call functions in Component A from Component B.
This example shows you how to use a model (e.g. $this->Load('Model') ) from within a component, so you can use models like you would in a native controller.
CakePHP 4 Using an app.php or app_local.php Variable in Components or Controllers
This CakePHP 4 component lets you easily handle cookies. This example sets a unique ID cookie.
Write and read cookies in your CakePHP 4 app.
Components are re-usable bits of code you can call anywhere throughout your application.
Generate a random token or string of characters & numbers of any given length.
Joining a single table on multiple fields in CakePHP 4, for example, join the users table on created_by and modified_by fields.
Free Templates & Tools for Your Website
Validate Existing Password when Changing Password in CakePHP 4
Get Items to Populate a Dropdown in CakePHP 4
Use this example to sort by a specific value in a field within your table, then sort by other fields.
How to use CakePHP Bake Features to generate your models, views (templates) and controllers, automatically!
Get a Unique ID in PHP
This is a quick example for PHP in implementing reCaptcha (v2)
CakePHP4 Mailer Usage - Gmail - Email Transport Example with CakePHP 4.
VS Code - Disable MDN references, and/or delay hover popup.
Some of the top free places to find icons for your websites & development.
The top websites with free photos, images, illustrations and videos for your use.
Read & Write Cookies in CakePHP 3
When using the CsrfProtectionMiddleware, this will demonstrate how to remove CSRF protection. Useful when handling some AJAX calls that need to post keys, such as captcha or payment APIs.
Simple example of getting locations from Square, using CURL & Get with PHP.
This example shows you how to get a customer list from an authorized Square Account
Test Credit Card Numbers for Square Payments
This example shows how to the get name of the controller or method in CakePHP3
These examples show the differences in inserting records when in CakePHP3 & CakePHP4.
This demo shows you how to prompt the browser to suggest a new password.
This example shows you how to get the count of records within the last 7 days. In our table, we have the full date and time; This example shows all records for a complete day, grouped by day.
This example shows how to get Querystring parameters from a URL.
This example shows you how to change the layout in CakePHP4
Editing Templates, etc. for Bake in CakePHP3 & CakePHP4
This example shows you how to randomize results returned in MySql / MariaDB
Adding HTML to a link in CakePHP 3
Access Methods From Another Controller in CakePHP3
This example shows you how to use an origin table to create a new table, and populate the new table with contents from the origin.
Using INSERT SELECT to copy & populate one table from another.
How to fix the 1366 incorrect string value "\xE2\x80\x8B} ... error.
Retrieve Errors on Execution of a CakePHP Data Method (e.g. when saving)
Convert an Object to an Array in PHP
Use .htaccess to Access Your Pages Without Using an Extension
Hashing a password in CakePHP3
Format a date to YYYY-MM-dd from object(Cake\18n\FrozenTime)
Copy one table from another, across databases with MariaDB / MySql.
This example shows you how to get the reverse route for a controller/action in CakePHP4.
This example shows you how to throw an error in CakePHP4
This snip shows you how to get server and environmental information in CakePHP4.
This article describes my trek with Notion, and how I use it / recommend it for productivity, managing tasks and notes.
Using Robocopy to rapidly mirror directories
Execute any custom parameterized query or SQL statement in CakePHP.
Get insert id from last added record in CakePHP.
Including Vendor Files (e.g. Authorize.net) in CakePHP 3
This example shows how to send an email from within a method in your controller.
Render a different view in CakePHP. Sometimes you want to use a different view, other than the default CakePHP uses.
This example shows you how to get the referring page, so you can provide your user with a link to their last page.
This example demonstrates saving multiple-list records in CakePHP, including form, and handling the post.
This example shows you how to use CSS to replace the spinners / incrementers on HTML5 number-type fields.
This demonstrates how to use multiple joins in your CakePHP database calls.
This example shows you how to replace strings in table rows for a specific database field.
This describes how to fix the issues in CakePHP4 related to this error: Laminas\Diactoros\UploadedFile.Laminas Diactoros
This demonstrates how to lengthen or shorten the session timeout for a logged-in user, in CakePHP. This functionality controls when the user's session times out.
This describes how to assign variables so you can use them later in views or layouts.
This describes how to get user information for the logged-in account in CakePHP4
Here's a brief few snippets for using sessions in CakePHP4.
Authentication in CakePHP4 (Strawberry)
This is an example on how to get the webroot from within a Cake layout or template.