Entries by

Creating a CSV File Using PHP

PHP has defined functions for creating CSV files. Using these functions instead of libraries like PhpExcel has several advantages. They consume fewer resources and are therefore faster. First, let's create the function that will create our CSV file. function array_to_csv_function($array, $filename = “export.csv”, $delimiter=”;”) { // Instead of opening a temp file, we're using memory. $f = fopen('php://memory', 'w'); // […]

How to Install Linux, Apache, MySQL, PHP (LAMP) on Ubuntu?

Installing the Default LAMP Package on Ubuntu If you want to install LAMP in the easiest way, simply type the following commands in the terminal. $ sudo apt-get update $ sudo apt-get install lamp-server^ Don't forget to type the "^" character, otherwise you'll get an error. Installing Linux, Apache, MySQL, and PHP on Ubuntu If you want to install them all separately, you're in the right place. It's a bit more involved, but it should give you […]

WordPress Security Precautions

Security Precautions During WordPress Installation: 1) Create a strong database user password. It should contain uppercase and lowercase letters, numbers, and special characters. 2) Avoid simple and easily guessed names like database, db, admin, and database. 3) WordPress asks for a prefix during the installation screen. By default, it's wp_. This database […]

WordPress Xmlrpc Vulnerability and Solution

There's a vulnerability in WordPress. Attacks can occur through the xmlrpc.php file. This file, which normally only works when data is sent via POST, can be exploited for malicious purposes. DDoS attacks are possible. To determine if the vulnerability exists, go to a URL on your site like "www.yoursite.com/xmlrpc.php." If you see a result like the image below, you have this vulnerability. To fix this vulnerability […]

Deleting or Closing WordPress Post Versions

WordPress has a feature called post versions. When you make changes to a published post, it keeps a separate record of the previous version for each change. However, this can sometimes be frustrating and harmful. For example, if you make 10 changes to a post, there will be 10 older versions. As your site's content increases, this will cause your database to bloat and slow down. Therefore, here […]

PHP Lesson 3 – Data Types

In PHP, as in other languages, there are different types of data. These data types have different uses. Integer: "All numbers." Float: "Numbers like 4.2." String: "Text." Array: "Arrays can contain multiple data types." Boolean: "Binary value system. Like True, False." Constant: "Immutable constants." Objects: "Objects of the OOP system." Integers are numbers. Mathematical operations can be performed with this data.