SQL Injection is a method of an attacker altering SQL commands to expose, override data or execute dangerous commands. Preventing SQL injection in PHP can be achieved by following the steps in the post below.
Consider a simple form that contains a username and password field. Without sufficient security measures, the attacker could add the ...
Cross Site Scripting (XSS) is one of the most common forms of security attacks that happens against websites. This article will show you simple methods of preventing XSS in PHP.
The attack focuses on injecting code which can happen if user input isn’t correctly sanitised or escaped when being output to the browser. This can ...
With all programming languages, Swift comes with its own syntax of declaring variables, functions and so on. Here are some code examples representing the basic syntax for Swift 3.
In order to test the code, it is recommended to use the Xcode playground. This can be opened by opening up Xcode, and choosing the ‘Get ...
A wide variety of new HTML5 elements have been introduced in the latest version of HTML. We can break some of the more commonly used new elements down into three different groups: Structural, Input Attribute Syntax and Media.
Structural
The <article> tag is used for self-contained content, such as a blog post or a news ...
Preventing CSRF in PHP is fairly easy if known how to do so, however there are many websites that are vulnerable to this type of attack.
Cross Site Request Forgery (CSRF) is a type of attack that occurs when a malicious site or email causes a user’s browser to perform an unwanted action on a ...
Git, like other VCSs has the ability to mark specific points in history as being important. You have have seen that when particular projects or applications are released, their version numbers may be present alongside the release notes (v1.0, v1.1 etc.). We can add relevant version numbers in Git as well. The following post will ...
Swift is a programming language for macOS, iOS, watchOS and tvOS. The third version of Swift was released earlier this year, and is available for Xcode 8. This article will help beginners in getting started with Swift 3, and setting up a basic project within Xcode.
To start with, open up Xcode and create a ...
When using .scss files, it’s good to have a basic sass project structure so that you can separate out functionality such variable declarations, css resets and so on.
For simplicity, we’ll assume that your css assets are located within your project’s ‘css’ directory. So to start with, create a ‘main.scss’ file and use the sass ...
The git log command allows you to view the commit history of a repository. This is especially useful if you want to look back over previous changes, whether they’ve been carried out by you or other developers.
When running the command, you will probably get something like the below.
$ git log
commit ca82a6dff817ec66f44342007202690a93763949
Author: ...
Continuing on from adding a UI Grid Component in Magento 2, here’s how to add a Magento 2 admin form.
To start with, add a controller for the ‘add’ post action. This will simply forward to the ‘edit’ controller action, as we can use the same functionality for both actions.
// app/code/Siphor/News/Controller/Adminhtml/Post/Add.php
<?php
namespace Siphor\News\Controller\Adminhtml\Post;