(Solved) UTF-8 all the way through

Data Storage: Specify the utf8mb4 character set on all tables and text columns in your database. This makes MySQL physically store and retrieve values encoded natively in UTF-8. Note that MySQL will implicitly use utf8mb4 encoding if a utf8mb4_* collation is specified (without any explicit character set). In older versions of MySQL (< 5.5.3), you’ll … Read more

(Solved) How to fix “Headers already sent” error in PHP

Introduction Headers already sent error is a common issue encountered by PHP developers. This error occurs when the server sends the response to the browser before the header information is sent. This can be caused by a number of things, such as extra whitespace, incorrect line endings, or even a missing semicolon. Fortunately, this error … Read more

(Solved) How to fix “Headers already sent” error in PHP

No output before sending headers! Functions that send/modify HTTP headers must be invoked before any output is made. summary ⇊ Otherwise the call fails: Warning: Cannot modify header information – headers already sent (output started at script:line) Some functions modifying the HTTP header are: header / header_remove session_start / session_regenerate_id setcookie / setrawcookie Output can … Read more

(Solved) PHP parse/syntax errors; and how to solve them

What are the syntax errors? PHP belongs to the C-style and imperative programming languages. It has rigid grammar rules, which it cannot recover from when encountering misplaced symbols or identifiers. It can’t guess your coding intentions. Most important tips There are a few basic precautions you can always take: Use proper code indentation, or adopt … Read more

(Solved) Why shouldn’t I use mysql_* functions in PHP?

Introduction Solution The mysql_* functions in PHP are deprecated and no longer supported. They are also vulnerable to SQL injection attacks, which can be used to gain access to sensitive data. Additionally, the mysql_* functions are not compatible with the newer versions of PHP, so using them can lead to compatibility issues. For these reasons, … Read more

(Solved) Why shouldn’t I use mysql_* functions in PHP?

The MySQL extension: Is not under active development Is officially deprecated as of PHP 5.5 (released June 2013). Has been removed entirely as of PHP 7.0 (released December 2015) This means that as of 31 Dec 2018 it does not exist in any supported version of PHP. If you are using a version of PHP … Read more

(Solved) “Notice: Undefined variable”, “Notice: Undefined index”, “Warning: Undefined array key”, and “Notice: Undefined offset” using PHP

Notice / Warning: Undefined variable From the vast wisdom of the PHP Manual: Relying on the default value of an uninitialized variable is problematic in the case of including one file into another which uses the same variable name. It is also a major security risk with register_globals turned on. E_NOTICE level error is issued … Read more