Thursday, 7 July 2022

Automatic Schedule a Task in PHP

 AUTOMATIC SCHEDULE A TASK IN PHP

AUTOMATIC EXECUTION CODE

1. Cron Jobs

2.Schedule a Task

What is Schedule a Task?

In case to set time, automatically execute any script or logic then we can define "Schedule". That script can execute particular date, week, month, hours, daily etc. In PHP in easy way to do Schedule task. so many methods in command line arguments code.

In PHP, Webserver have Schedule task section






Add Task

Have three option 

    Run Command
    Fetch URL
    Run a PHP Script

 httpdoc/crontask.php


If you need PHP script execute automatically, then specify / Browse the PHP file 

Ex: httpdoc/crontask.php

<?php
$st=date("Y-m-d");
include("config.php");
$q="insert into crontask values('','$st')";
$r=mysqli_query($con,$q);
?>

Select Cron Style : */1 * * * *

It means  Each 1 mins script run automattically.

use the UNIX crontab format "min hour day-of-month month-of-week" 

for example 0 22 ** 1-5.

Webserver Plesk use the default system timezome to run the task.


NOTE : 

In case timezone not working in your server, Configure the PHP.INI file, set timezone settings.

What of need your automatic schedule task and command set after apply the settings

Finally Run the Task

Thats all.. Your code automatically working when your server on/off anytime, that code was working automatically.





Wednesday, 6 July 2022

URL bar color change in html -Simple Method

HOW TO CHANGE BROWSER THEME-COLOR / URL / ADDRESS BAR COLOR CHANGE

URL BAR COLOR CHANGE IN HTML

In HTML page URL/ADDRESS BAR section to change color or theme,

In this post, we will know how to change URL/Address bar theme color change in HTML document. If you designing dark theme based web document, but URL section only displayed white. We feel that section should same theme then good. Its very simple and easy method, Just add theme-color in Meta-tags attribute. 

META-TAG

the <meta> tag is used to inside the <head> tag. 

It defines meta-data about the HTML document.

HOW TO USE

<meta> tag used two attributes

name  attribute = name of the theme attribute - theme-color

content attribute = color of theme - Hexadecimal value

SYNTAX & EXAMPLE

<meta name="theme-color" content="#1bb566">

FULL CODE

<!DOCTYPE html>

<html>

  <head>

    <title>Easy Making Web Apps</title>

    <meta name="theme-color" content="#1bb566">

 </head>

  <body>

    <h1>Welcome To Easy Making Web Apps</h1>

</body>

  </html>


Easy convert two digit decimal points in PHP with Source Code

CONVERT TWO DIGIT DECIMAL POINTS IN PHP 

Hi friends & Students

In this post we see, how to convert two digit decimal points in PHP detailed

Ex:

20.0 = 20.00

1450.5 = 1450.00

PHP CODE

$variable="20.5"; // 20.50

$variable="1450.5"; //1450.50

Like this kind of needs, Use number_format() methods, very easy varibalename,number of digits. 

Ex:

number_format($variable, 2);

PHP EXAMPLE CODE :

<?php

$price="20.5";

$res=number_format($price, 2);

echo "Rs.".$res;

?>

OUTPUT

Rs.20.50

What is AI- Artificial Intelligence - தமிழில்

Artificial Intelligence : Artificial intelligence leverages computers and machines to mimic the problem-solving and decision-making capabili...