Skip to content

WebCheatSheet

The easy way to know

  • PHP
  • HTML
  • JavaScript
  • SQL
  • ASP
  • MS Access Functions
  • SaaS
  • Email

Category: PHP

PHP

Pass Controller Data to a PHP MVC View

Sergey KornilovOctober 10, 2026

Let a PHP controller validate request data, call the model, and pass an explicit view-data array to a template.

PHP

Recover from MySQL Server Has Gone Away Before a Transaction

Sergey KornilovOctober 10, 2026

Refresh an idle PHP PDO connection before starting a MySQL transaction, while avoiding unsafe retries after writes begin.

PHP

Set the PHPMailer Envelope Sender Correctly

Sergey KornilovOctober 10, 2026

Set the visible From address and SMTP envelope sender separately in PHPMailer without manually adding a Return-Path header.

PHP

Reject NUL Bytes Before Saving PostgreSQL Text with PHP

Sergey KornilovOctober 10, 2026

Detect NUL bytes in PHP before inserting text into PostgreSQL, and use bytea when the value is truly binary data.

PHP

Fix Local PHP Asset 404 Errors by Setting the Document Root

Sergey KornilovOctober 9, 2026

Make local CSS, SVG, and image URLs match production by starting the PHP development server with the correct public document root.

PHP

Enable PHP Session Strict Mode and Regenerate IDs Safely

Sergey KornilovOctober 9, 2026

Enable PHP session strict mode, secure the session cookie, and regenerate the ID after authentication without accepting attacker-supplied IDs.

PHP

Reject Excessively Nested Query Strings in PHP

Sergey KornilovOctober 8, 2026

Turn PHP parse_str nesting warnings into a controlled 400 response and limit query-string complexity before malformed requests reach application code.

PHP

Keep PHP Image Uploads and Database Records in Sync

Sergey KornilovOctober 8, 2026

Coordinate PHP file moves with PDO transactions and compensating cleanup so failed product-image updates do not leave broken records or orphaned files.

PHP

Fix PHP 8.5 Null Array Offset Deprecation Warnings

Sergey KornilovOctober 7, 2026

Stop PHP 8.5 null array offset warnings by validating or deliberately normalizing keys before array access and array_key_exists calls.

PHP

Upload a Custom YouTube Thumbnail with PHP

Sergey KornilovOctober 7, 2026

Upload a JPEG or PNG thumbnail through the YouTube Data API PHP client using media request options and an OAuth access token.

Posts navigation

Older posts

Recent Posts

  • Pass Controller Data to a PHP MVC View
  • Recover from MySQL Server Has Gone Away Before a Transaction
  • Set the PHPMailer Envelope Sender Correctly
  • Speed Up SQL Server JDBC Batch Inserts with Bulk Copy
  • Reject NUL Bytes Before Saving PostgreSQL Text with PHP

Recent Comments

  1. Build Accessible Tabs with JavaScript – WebCheatSheet on How to Control Tab Order in HTML
  2. Verify SQL Server Backups with CHECKSUM and VERIFYONLY – WebCheatSheet on Fix SQL Server ‘Insufficient Access Rights’ During Backup
  3. Get the Latest MySQL Value Before Two Dates – WebCheatSheet on SQL GROUP BY
  4. Count Duplicate Values in a JavaScript Array – WebCheatSheet on JavaScript Arrays
  5. Fix MySQL Error 1038 for Wide Rows and Filesort – WebCheatSheet on Determine the MySQL Version from the Command Line

Archives

  • October 2026
  • September 2026
  • August 2026
  • October 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022

Categories

  • ASP
  • Email
  • HTML
  • JavaScript
  • MS Access Functions
  • PHP
  • SaaS Architecture
  • SQL
  • Uncategorized
Copyright © 2026 WebCheatSheetFresh News by Ascendoor | Powered by WordPress.