Basics of XML

XML stands for Extensible Markup Language and is a hierarchically structured document consisting of nested tags that resemble HTML tags.

XML does not mean less storage space or quick access to information. However, XML lets you declare your own tags and is platform independent.

XML also enables the design of domain-specific markup language because namespaces are supported. Here is an example:

My first bundle with Webpack 4

Webpack is a open-source bundler for web assets like CSS or JavaScript files

To install Webpack you will need NPM to be installed on your computer or any similar package manager like Yarn.

Open a command line and go to the root directory of your project, then run

C:\>xampp\htdocs\webpack-project>npm install webpack –save-dev

 

Proceed to install CLI

C;\>xampp\htdocs\webpack-project>npm install –save-dev webpack-cli

 

Now create a package.json file in the root of your project directory with the following contents

package.json

Create also a webpack.config.js file in the root of your project directory with the following contents

webpack.config.js

Create a new folder named assets and a new folder named js in the assets folder with the following Javascript file

index.js

Create a HTML File which we will use later to see if everything works fine

Open a command line and go to the root directory of your project, then run:

C:\>xampp\htdocs\webpack-project>npm run build

 

Run also:

C:\>xampp\htdocs\webpack-project>npm run watch

 

for Webpack to create a new bundle everytime changes are made to the JavaScript file

Finnaly click the Click me button and an alert box should be displayed if everything is working fine

Configuring your web server with .htaccess

A .htaccess file helps you to configure your web server, such as the Apache web server.

In a .htaccess file, you can declare rewrite rules, prevent image hotlinking, handle bad http requests (404 Not Found), and so on.

You can even use htaccess for basic authentication along with a .htpassword file where you can store usernames and passwords.

The configuration in the .htaccess file affects the current directory including its subdirectories. You can override the .htaccess file in the subdirectories by simply declaring another .htaccess file

Here are some examples:

Handle a bad request (404 Not Found)

.htaccess

Use htaccess for basic authentication (Grant access only to user: gunther with password: today)

.htaccess

.htpasswd

Redirect all requests to news/url to news.php?url=url

What is Bootstrap?

Bootstrap is the most popular front-end framework for building responsive, mobile-first apps.

JavaScript Object Literals

An object literal is a comma-separated list of name-value pairs wrapped in curly braces. Object Literals can contain others Object Literals, Arrays and Functions.

Connecting to a MySQL Database with the PHP library PDO

PDO stands for PHP Data Objets and support Prepared Statements

you can also use the bindParam method, like: