Tag: websites

Alternatives for Google Domains

For the second year now, I have been using Google Domains to register domains – I really like their service: low prices, free Domain Privacy, convenient management, no restrictions, automatic verification of sites in Google Search Console. Overall, I could definitely recommend this domain registrar if it still worked... Note: Domain Privacy is the hiding of your personal data (your...

PHP Fatal error: Uncaught mysqli_sql_exception: No database selected (SOLVED)

Let's look at a small PHP code that tries to connect to a MySQL or MariaDB DBMS and execute a query with a “SELECT” statement: <?php $db_user = "root"; $db_password = ""; $mysqli = new mysqli("localhost", $db_user, $db_password); if ($mysqli->connect_errno) { printf("Somehow we failed: %s\n", $mysqli->connect_error); exit(); } $query = "SELECT * FROM TestTABLE;"; $result = $mysqli->query($query); while ($row =...

“ERROR 1366 (22007): Incorrect string value” in MySQL/MariaDB (SOLVED)

How to insert emoji into MySQL/MariaDB database On the one hand, inserting emoji into a MySQL / MariaDB database table does not require any special preparatory steps – just insert one or more emoji characters, which may contain other text. For example: INSERT INTO TestTABLE (`test_column`) VALUES ("🎫⏭️✈️ and hi 🌅"); But when executing the previous request, you may encounter...

PHP not displaying emoji from MySQL/MariaDB database (SOLVED)

When retrieving rows from a MySQL (MariaDB) database, you may encounter a situation where all the text is displayed correctly, but question marks are displayed instead of emoji. The most likely problem is an incorrectly used encoding when executing queries against the MySQL (MariaDB) DBMS. There are two ways to fix this situation. 1. Select utf8mb4_unicode_ci encoding when creating database...

Automatic code highlighting on websites

Automatic markup of code on sites In this article, you will learn how to enable syntax highlighting of the source code on your websites. Code highlighting means automatic coloring of program source code elements in different colors in accordance with the syntax of the programming language. The shown option is suitable for both WordPress sites and any other sites. Note:...

How to get data from a web page using GET and POST methods in a Python script on Windows

Python programs and scripts can make requests to and receive data from websites and web services using the GET and POST methods (as well as other HTTP methods: PUT, PATCH and DELETE). But what if you want to pass data from a web page to a Python script? This can be done in several ways. How to get data from...

How to get data from a web page using GET and POST methods in a Python script

Python programs and scripts can make requests to and receive data from websites and web services using the GET and POST methods (as well as other HTTP methods: PUT, PATCH and DELETE). But what if you want to pass data from a web page to a Python script? This can be done in several ways. How to get data from...

How to install Python as a CGI module in Apache on Linux

Table of contents 1. How to run a Python script on a web server 2. How to set up Python as a CGI module in Apache on Debian (Ubuntu, Linux Mint, Kali Linux) 2.1 Setting up Python CGI for a single directory 2.2 Setting up Python CGI for the entire web server 3. How to set up Python as a...

How to set up Python as a CGI module in Apache on Arch Linux (Manjaro, BlackArch)

Setting up Python CGI for a single directory Create a directory /srv/http/cgi-bin/ - this is where the Python scripts will be located: sudo mkdir /srv/http/cgi-bin/ Open the /etc/httpd/conf/httpd.conf file – the web server configuration file: sudo gedit /etc/httpd/conf/httpd.conf Find a group of lines: <Directory "/srv/http/cgi-bin"> AllowOverride None Options None Require all granted </Directory> And replace it with: <Directory "/srv/http/cgi-bin"> AllowOverride...

How to set up Python as a CGI module in Apache on Debian (Ubuntu, Linux Mint)

Setting up Python CGI for a single directory Run the command to enable the CGI module: sudo a2enmod cgi Restart the web server for the changes to take effect: sudo systemctl restart apache2 Create file /usr/lib/cgi-bin/test.py: sudo gedit /usr/lib/cgi-bin/test.py Copy the following content to this file: #!/usr/bin/python3 print ("Content-type: text/html") print ("") print ("") print ("<html><head>") print ("") print ("</head><body>")...
Loading...
X