Result:

Code:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="35" height="35" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29l-4.3 4.29a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l4.29-4.3l4.29 4.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42z"/></svg>

 

There was a problem that after updating Android to version 11, the notification bar stopped working [ phone model - Realme 6 pro, but it may work for others as well].

How did we fix it:

First you need to check that this item is active in your phone settings:

Settings - Notifications and status bar - “Pull down on the lock screen to open the notification panel”

Then we blocked the phone.  In the locked mode we tried to pull out the notification bar.

After the notification bar is activated in the locked mode, it starts to work in the main mode as well.

Sometimes it is necessary to show the user html form content, but so that the user does not have the opportunity to change anything on it.

There are different ways to do this, but the simplest is to surround the form with a fieldset tag with the disabled = "disabled" attribute:

 

<fieldset disabled="disabled">
<form>
<input type="text" name="example" value="123" />
</form>
</fieldset>


Sometimes you need to send an XML data using cURL:

	$xml = '
<?xml version="1.0" encoding="UTF-8"?>
<data>
<name>Jonh</name>
<surname>Smith</surname>

</data>';

// POST data:
$postData = array(
'name' => $name,
'xml' => $xml
);

$url = 'http://myaddress.com'; //address
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if(curl_errno($curl)){
throw new Exception(curl_error($curl));
}
curl_close($curl);

  $xml  variable contains xml data; 

Changing the step in input type = number is very simple, just use  step attribute:

<input type="number" name="input_name" step="0.01">

In this example, clicking on the arrows will switch input in 1/100.

Other example:

<input type="number" name="input_name" step="0.1">

You can also specify non-fractions, for example, if you specify step = "2", then input will switch only by even numbers:

<input type="number" name="input_name" step="2">

If step attribute is not specified, the default value is 1.

In all those cases user can manually enter any number so if you want to control user entered number you should write a separate validation!

Sometimes it is necessary  to send data with cURL using both GET and POST data, a simple example:

	$name = 'John';
$surname = 'Smith';
// will be sent via POST:
$postData = array(
'name' => $name,
'surname' => $surname
);

// will be sent via GET as parameter string
$getData = '?city=London&param=1&test=22';
$url = 'http://myaddress.com' . $getData; //address
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
if(curl_errno($curl)){
throw new Exception(curl_error($curl));
}
curl_close($curl);

$postData - a  data array to be sent via POST

$getData -  GET string with parameters

The easiest way to do this is to set the minimum value in html:

<input type="number" min="0">

If 0 is also not allowed, you can set min = "1" or any other number you need.

This will limit the number selector on the right side of the input, but does not add any extra checks in case the user entered a negative number manually!

To avoid this, you can add a small js check:

<input type="number" name="input_name" min="1" 
oninput="validity.valid||(value='');">

Sometimes it is necessary to intercept an event when the user types some text. For example, a user fills in a search field and presses Enter to confirm his action.

If you need to do something by pressing the Enter button, you need to write a handler:


$(document).ready(function () {
$("#inputId").keydown(function (e) {
if (e.keyCode == 13) { //do something
}
});
});

In this example “13" is the code of the Enter button;

You can substitute the code of any other button instead of 13.

 <input type="text" id="inputId" name="my_name" value="" />

**inputId** - must match the ID in input

 

There are several ways to rename an already created mySQL table:

RENAME TABLE `table_from` TO `table_to`;

Alternative solution:

ALTER TABLE `table_from` RENAME TO `table_to`;

Where:

`table_from`  - the name of the table to be renamed
`table_to` - new table name