Tutorial by Examples: ti

$title = sanitize_text_field( $_POST['title'] );
The returned value is intended to be suitable for use in a URL, not as a human-readable title. Use sanitize_text_field instead. $new_url = sanitize_title($title);
$post_class = sanitize_html_class( $post->post_title ); echo '<div class="' . $post_class . '">';
$incfile = sanitize_file_name($_REQUEST["file"]); include($incfile . ".php"); Without sanitizing the file name an attacker could simple pass http://attacker_site/malicous_page as input and execute whatever code in your server.
$user = sanitize_user("attacker username<script>console.log(document.cookie)</script>"); $user value after sanitize is "attacker username"
Lets say you want to filter a query by two columns, but only certain combinations of those columns. For example, it's OK to have account 60400 with reference JE, but you cannot have account 60400 with reference ED, but you can have account 60500 with reference ED. select * from schema.table where ...
First off you create the form @using (Html.BeginForm()) { @Html.AntiForgeryToken() } Action Method [HttpPost] [ValidateAntiForgeryToken] public ActionResult Test(FormViewModel formData) { // ... } Script <script src="https://code.jquery.com/jquery-1.12.4.min.js"&g...
Exchange/convert a partition to a non-partitioned table and vice versa. This facilitates a fast "move" of data between the data segments (opposed to doing something like "insert...select" or "create table...as select") as the operation is DDL (the partition exchange ope...
AdfmfContainerUtilities.invokeContainerJavaScriptFunction(AdfmfJavaUtilities.getFeatureId(), <function>, new Object[] { }); "function" is the desired js function to be invoked
Achieving multitenancy on database server with multiple databases hosted on it. Multitenancy is common requirement of enterprise application nowadays and creating connection pool for each database in database server is not recommended. so, what we can do instead is create connection pool with datab...
Another approach to handling asynchrony in Redux is to use action creators. In Flux, action creators are special functions that construct action objects and dispatch them. myActionCreator(dispatch) { dispatch({ type: "ASYNC_ACTION_START" }); setTimeout(() => { dispatch({ typ...
JS // data model var person = { name: ko.observable('Jack'), age: ko.observable(29) }; ko.applyBindings(person); HTML <div> <p>Name: <input data-bind='value: name' /></p> <p>Age: <input data-bind='value: age' /></p> &l...
app.js angular.module('myApp', ['ui.router']) .service('User', ['$http', function User ($http) { this.getProfile = function (id) { return $http.get(...) // method to load data from API }; }]) .controller('profileCtrl', ['profile', function profileCtrl (profile) { // i...
url: /api/data/v8.0/annotations json: { "isdocument": true, "mimetype": "text/plain", "documentbody": "dGVzdA==", "[email protected]" : "/accounts(c6da77b6-d53e-e611-80b9-0050568a6c2d)", "...
url: /api/data/v8.0/accounts json: { "name" : "New account" }
url: /api/data/v8.0/contacts json: { "firstname" : "New", "lastname" : "Contact", "[email protected]" : "/accounts(c6da77b6-d53e-e611-80b9-0050568a6c2d)" } As the parentcustomerid can be an account or ...
Matplotlib has its own implementation of boxplot. The relevant aspects of this function is that, by default, the boxplot is showing the median (percentile 50%) with a red line. The box represents Q1 and Q3 (percentiles 25 and 75), and the whiskers give an idea of the range of the data (possibly at Q...
First of all download Yii Booster latest end user bundle from here. Download it, unpack its contents to some directory inside your web application. Its recomended to unpack it to the extensions directory. Rename the folder from yiibooster-<version_number> to just yiibooster for convenience. ...
This is the equivalent of the other example but using ES6 instead. export function printHelloWorld() { console.log("Hello World!!!"); }

Page 327 of 505