-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label PHP 7 Tutorial HyperText Preprocessor. Show all posts
Showing posts with label PHP 7 Tutorial HyperText Preprocessor. Show all posts
  • MySQL Transactions


    MySQL Transactions

     

     

    MySQL Transactions


    What are transactions?

    # Sequential group of DML statements, which is performed as if it were one single work unit.


    # Will never complete unless each individual operation within the group is sucessful.If any operation within the transaction fails, the entire transaction will fail.

    # Begins with the first executable SQL statement.

    # Ends when it is committed or rolled back, either explicitly with a COMMIT or ROLLBACK statement or implicitly when a DDL statement
    is issued.




    Sample Scenario



    Suppose a bank customer transfers money from his savings account (SB a/c) to his current account (CA a/c), the statement will be divided into four blocks:



    # Debit SB a/c
    # Credit CA a/c
    # Record in Transaction Journal.
    # End Transaction




    The SQL statement to debit SB a/c is as follows:

    UPDATE sb_accounts SET balance = balance - 500 WHERE account_no = 932656;



    The SQL statement to credit CA a/c is as follows:

    UPDATE ca_accounts SET balance = balance + 500 WHERE account_no = 933456;



    The SQL statement for recording in the transaction journal is as follows:

    INSERT INTO journal VALUES (100896, 'Transaction on Kumar Atul Jaiswal a/c', '28-NOV-11' 932656, 933456, 500);


    The SQL statement for End Transaction is as follows:


    COMMIT WORK;

     

     

    Ensures that all operations within the work unit are completed successfully; otherwise, the transaction is aborted at the point of failure and previous operations are rolled back to their former state.

     

     

    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • Deleting data from database by user input

     

    Deleting data from database by user input

     

     Deleting data from database by user input

     

     

    There are different programming languages currently in use, of which some are open source while others are proprietary. Open source basically refers to a program in which the source code is available to the public, free of cost, for use or for modification from its original design.

    Here we will Deleting data from database by user input for which we will use programmatic method with the help of PHP and MYSQL .

     

    Syntax of PHP


     <?php

     

     //Content goes here 

     

    ?>

     

     

     

    deletingdata.php

     

     

    <!DOCTYPE html>
    <html>
    <head>
    <title>Deleting Data</title>
    
    <style>
    
    body {
    	background: linear-gradient(to right, #1e5799 0%, #3ccdbb 20%, #16c9f6 100%);
    	
    }
    
    .form-css
    {
    	top: 50%;
    	left: 50%;
    	transform: translate(-50%, -50%);
    	position: absolute;
    	background-color: white;
    	border: 2px solid black;
    	border-radius: 20px;
    	padding: 50px;
    }
    
    
    .avatar-image img
    {
    	 justify-content: center;
    	 top: 0%;
    	 left: 50%;
    	 transform: translate(-0%, -50%);
    	position: absolute;
    	border: 1px solid black;
        border-radius: 50%;	
    	
    }
    
    button {
    	font-family: sans-serif;
    	padding: 5px;
    	cursor: pointer;
    }
    
    
    </style>
    
    
    
    
    </head>
    
    <body>
    <div class="container">
    
    <form action="controller/deletingdata-db.php" method="POST" class="form-css">
    <div class="avatar-image">
    <img src="image/avatar.png"  alt="avatar">
    </div>
    <br />
    <br />
    <label>Delete Data with ID Number</label>
    <br />
    <br />
    <input type="text" name="id" placeholder="Enter ID Number">
    <br />
    <br />
    <button type="submit" name="submit">Deleting Data</button>
    
    </form>
    </div>
    
    </body>
    </html>
    
    

     

     

     

    Then again we will create a new file called deletingdata-db.php and this file related with above the program for database as a mediator.

     

    deletingdata-db.php

     

     

    <?php
    
    
    require_once("connectionstring.php");
    
    
    $id = $_POST["id"];
    
    
    if(!$conn)
    {
    die("Connection Problem : " . mysqli_connect_error());
    }
    
    
    $sql = "Delete FROM logintable WHERE id='$id'";
    
    
    if(mysqli_query($conn, $sql))
    {
    	echo "<br>";
    	echo "<br>";
        echo "It has been deleted.";
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../gettingdata.php'>Getting Data From Database</a>";
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../deletingdata.php'>Deleting Data From Database</a>";
     
    }
    else {
    	echo "<br>";
    	echo "<br>";
        echo "Error. This name does not have an ID in our Database : " . mysqli_error($conn);
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../gettingdata.php'>Getting Data From Database</a>";
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../deletingdata.php'>Deleting Data From Database</a>";
    }
    
    
    mysqli_close($conn);
      
     
    ?>
    
    

     

     

    output

     

    Deleting data from database by user input

     

     

     

    Deleting data from database by user input

     

     

     

    Explaination




    => require_once("connectionstring") - This will produce a fatal error and stop the script.

    OR

    => include() - This will produce a warning and the script continue.



    => $conn is our new variable.


    => mysqli_connect() - The mysqli_connect() function attempts to open a connection to the MySQL Server running on host which can be either a host name or an IP address.


    Passing the NULL value or the string "localhost" or variable name to this parameter.

    Now we will check the connection whether the connection is working successfully or not!!  Actually here we will  "if and else" condition.


    => die()  - The die() function prints a message and exits the current script.


    => mysqli_connect_error() - This will produce a mysqli connection error and whats the reason of failure.


    => $sql - its a variable but in this variable we store the mysql query for select id, email
    password from table according to user input ID.



    =>  mysqli_query()
    -  mysqli_query() what it returns. The return value could be a boolean(true/false)



     

     

    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

  • Fetching data from database by user input

     

    Fetching data from database by user input


    Fetching data from database by user input

     

    There are different programming languages currently in use, of which some are open source while others are proprietary. Open source basically refers to a program in which the source code is available to the public, free of cost, for use or for modification from its original design.

    Here we will Fetching data from database by user input for which we will use programmatic method with the help of PHP and MYSQL.

     

     

    Syntax of PHP


     <?php

     

     //Content goes here 

     

    ?>

     

     


    gettingdata.php



    <!DOCTYPE html>
    <html>
    <head>
    <title>Getting Data</title>
    
    <style>
    
    body {
    	background: linear-gradient(to right, #1e5799 0%, #3ccdbb 20%, #16c9f6 100%);
    	
    }
    
    .form-css
    {
    	top: 50%;
    	left: 50%;
    	transform: translate(-50%, -50%);
    	position: absolute;
    	background-color: white;
    	border: 2px solid black;
    	border-radius: 20px;
    	padding: 50px;
    }
    
    
    .avatar-image img
    {
    	 justify-content: center;
    	 top: 0%;
    	 left: 50%;
    	 transform: translate(-0%, -50%);
    	position: absolute;
    	border: 1px solid black;
        border-radius: 50%;	
    	
    }
    
    button {
    	font-family: sans-serif;
    	padding: 5px;
    	cursor: pointer;
    }
    
    
    </style>
    
    
    
    
    </head>
    
    <body>
    <div class="container">
    
    <form action="controller/gettingdata-db.php" method="POST" class="form-css">
    <div class="avatar-image">
    <img src="image/avatar.png"  alt="avatar">
    </div>
    <br />
    <br />
    <label>Enter ID Number</label>
    <input type="text" name="id" placeholder="Enter ID Number">
    <br />
    <br />
    <button type="submit" name="submit">Getting Data</button>
    
    </form>
    </div>
    
    </body>
    </html>
    
    



     

     

    Then again we will create a new file called gettingdata-db.php and this file related with above the program for database as a mediator.

     

    gettingdata-db.php

     

     

    <?php
    
    
    require_once("connectionstring.php");
    
    $id = $_POST["id"];
    
    	
    	
    if(!$conn)
    {
    	die("Connection failed : " . mysqli_connect_error());
    	
    }
    
    
    
    $sql = "SELECT id, email, password FROM logintable WHERE id='$id'";
    
    $result = $conn -> query($sql);
    
    if($result -> num_rows > 0)
    {
    	//output data of each row
    	while($row = $result -> fetch_assoc())
    	{
    		
    		
    	echo "id : " . $row ["id"] . " - email : " .
    		$row ["email"] . " | Password : " . $row ["password"] . "<br>";
    	
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../deletingdata.php'>Deleting Data From Database</a>";
        echo "<br>";
    	echo "<br>";
    	echo "<a href='../gettingdata.php'>Getting Data From Database</a>";
    
    
    	}
    }
    else {
    	echo " 0 results ";
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../deletingdata.php'>Deleting Data From Database</a>";
    	echo "<br>";
    	echo "<br>";
    	echo "<a href='../gettingdata.php'>Getting Data From Database</a>";
    
    }
    
    mysqli_close($conn);
    	
    
    ?>
    
    

     

     

    output

     

     


     

     

     

     


     

     

    Explaination




    => require_once("connectionstring") - This will produce a fatal error and stop the script.

    OR

    => include() - This will produce a warning and the script continue.



    => $conn is our new variable.


    => mysqli_connect() - The mysqli_connect() function attempts to open a connection to the MySQL Server running on host which can be either a host name or an IP address.


    Passing the NULL value or the string "localhost" or variable name to this parameter.

    Now we will check the connection whether the connection is working successfully or not!!  Actually here we will  "if and else" condition.


    => die()  - The die() function prints a message and exits the current script.


    => mysqli_connect_error() - This will produce a mysqli connection error and whats the reason of failure.


    => $sql - its a variable but in this variable we store the mysql query for select id, email
    password from table according to user input ID.


    => $result -> $conn -> query() - For successful queries which produce a result set, such
    as SELECT, SHOW, DESCRIBE or EXPLAIN , mysqli_query() will return a mysqli_result object.
    For other successful queries, mysqli_query() will return true .


    =>  mysqli_query()
    -  mysqli_query() what it returns. The return value could be a boolean(true/false)


    =>  mysqli_fetch_assoc() - This function fetches a result row as an associative array.
    Note: Fieldnames returned from this function are case-sensitive.



     

     

    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

  • Adding content in table with the help of PHP and MySQL

     

    adding content in table with the help of PHP and MySQL

     

    There are different programming languages currently in use, of which some are open source while others are proprietary. Open source basically refers to a program in which the source code is available to the public, free of cost, for use or for modification from its original design.

    Here we will create table in database section for which we will use programmatic method with the help of PHP and MYSQL .


    Write a program to Add Content in Table with the help of PHP and MySQL ? 

     

    Syntax of PHP


     <?php

     

     //Content goes here 

     

    ?>

     

     


     

    <?php
    
    require_once("connectionstring.php");
    
    $host = 'localhost';
    $user = 'root';
    $pwd = '';
    $db = 'loginpanel';
    
    $conn = mysqli_connect($host, $user, $pwd, $db);
    
    // connection check
    
    if(!$conn)
    {
    	die("Connection failed : " . mysqli_connect_error());
    }
    
    
    $sqltable = "INSERT INTO `logintable` (`id`, `email`, `password`) 
    VALUES ('3', 'kumaratuljaiswal.com@gmail.com', 'truth@.inatul#!43')";
    
    
    
    if(mysqli_query($conn, $sqltable))
    {
    		echo "Adding Table Content Created Successfully";
    }
    else 
    {
    	echo "Error adding table content : " . mysqli_error($conn);
    }
    
    
    
    
    mysqli_close($conn);
    
    
    
    ?>
    

     

     

     


     

     

     

     

     Explaination

     

     => $host = 'localhost';  $host is a variable which is used to store a value like localhost and localhost
    is our server.


    => $user = 'root'; $user as it same just like above the sentence but here is one difference and the difference
    is that its a user like root user of our xampp machine localhost.


    => $pwd = ''; 
     

    In this variable here is empty value of $pwd variable because we dont want any type of problem means no need of authentication.


    => $db = 'loginpanel'; - Loginpanel is our database name.


    Now you must be thinking what is this authentication!! dont worry click here for more information.


    => $conn is our new variable.


    => mysqli_connect() - The mysqli_connect() function attempts to open a connection to the MySQL Server running on host which can be either a host name or an IP address.


    Passing the NULL value or the string "localhost" or variable name to this parameter.

    Now we will check the connection whether the connection is working successfully or not!!  Actually here we will  "if and else" condition.


    => die()  - The die() function prints a message and exits the current script.


    => $sqltable - its a variable but in this variable we store the mysql query for inserting content in  table
    according to our demand.


    =>  mysqli_query() -  mysqli_query() what it returns. The return value could be a boolean(true/false)


     

     


    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

  • Create a table and its column with the help of PHP and MySQL

     

     

    Create a table and its column with the help of PHP and MySQL

     

     

    There are different programming languages currently in use, of which some are open source while others are proprietary. Open source basically refers to a program in which the source code is available to the public, free of cost, for use or for modification from its original design.

    Here we will create table in database section for which we will use programmatic method with the help of PHP and MYSQL .


    Write a program to create a Table and its column with the help of PHP and MySQL ? 

     

     

    Syntax of PHP


     <?php

     

     //Content goes here 

     

    ?>

     

     

    <?php
    
    $host = 'localhost';
    $user = 'root';
    $pwd = '';
    $db = 'loginpanel';
    
    $conn = mysqli_connect($host, $user, $pwd, $db);
    
    
    
    if(!$conn)
    {
    	die("Network Problem");
    	
    }
    
    $sql = "CREATE TABLE `loginpanel`.`logintable` ( `id` INT NULL AUTO_INCREMENT , `email` VARCHAR(50) NOT NULL , 
               `password` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`))";
    		 
    
    $result = mysqli_query($conn, $sql);
    
    if($result) 
    {
    	echo  "The table has been created successfully";
    }
    else {
    	echo "The table has not been created because of this error ---> " .mysqli_error($conn);
    }
    
    
    ?>
    
    

     

     

     Explaination

     

     => $host = 'localhost';  $host is a variable which is used to store a value like localhost and localhost
    is our server.


    => $user = 'root'; $user as it same just like above the sentence but here is one difference and the difference
    is that its a user like root user of our xampp machine localhost.


    => $pwd = ''; 
     

    In this variable here is empty value of $pwd variable because we dont want any type of problem means no need of authentication.


    => $db = 'loginpanel'; - Loginpanel is our database name.


    Now you must be thinking what is this authentication!! dont worry click here for more information.


    => $conn is our new variable.


    => mysqli_connect() - The mysqli_connect() function attempts to open a connection to the MySQL Server running on host which can be either a host name or an IP address.


    Passing the NULL value or the string "localhost" or variable name to this parameter.

    Now we will check the connection whether the connection is working successfully or not!!  Actually here we will  "if and else" condition.


    => die()  - The die() function prints a message and exits the current script.


    => $sql - its a variable but in this variable we store the mysql query for creating a table and its column
    according to our demand.


    =>  mysqli_query() -  mysqli_query() what it returns. The return value could be a boolean(true/false)



     

    Simply run in your favourite browser by xampp server



    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     


  • Create a Database with the help of PHP and MySQL

     

    Create a Database with the help of PHP and MySQL

     

     

    There are different programming languages currently in use, of which some are open source while others are proprietary. Open source basically refers to a program in which the source code is available to the public, free of cost, for use or for modification from its original design.

     

    Here we will create database for which we will use programmatic method with the help of PHP and MYSQL .

     

    Write a program to create a Database with the help of PHP and MySQL ? 

     

     Syntax of PHP

     <?php

     

     //Content goes here 

     

    ?>

     

    NOTE - // double forward slash is the comment in PHP.

     

     

    <?php
    
    $host = 'localhost';
    $user = 'root';
    $pwd = '';
    
    $conn = mysqli_connect($host, $user, $pwd);
    
    
    
    if(!$conn )
    {
    	die("Connection failed : " . mysqli_connect_error());
    }
    
    
    $sql = "CREATE DATABASE loginpanel";
    
    if(mysqli_query($conn, $sql))
    {
    	echo "Database created successfully";
    }
    else {
    	echo "Error Creating Database : " . mysqli_errno($conn);
    }
    mysqli_close($conn);
    
    
    ?>
    
    





    Explaination


    => $host = 'localhost';  $host is a variable which is used to store a value like localhost and localhost
    is our server.


    => $user = 'root'; $user as it same just like above the sentence but here is one difference and the difference is that its a user like root user of our xampp machine localhost.


    => $pwd = '';   

    In this variable here is empty value of $pwd variable because we dont want any type of problem means no need of authentication.

    Now you must be thinking what is this authentication!! dont worry click here for more information.


    => $conn is our new variable.


    => mysqli_connect() - The mysqli_connect() function attempts to open a connection to the MySQL Server running on host which can be either a host name or an IP address.

    Passing the NULL value or the string "localhost" or variable name to this parameter.

    Now we will check the connection whether the connection is working successfully or not!!  Actually here we will  "if and else" condition.

    => die()  - The die() function prints a message and exits the current script.

    => mysqli_connect_error() - PHP mysqli_connect_error() function returns an string value representing the description of
    the error from the last connection call, incase of a failure. If the connection was successful
    this function returns Null.

    =>  mysqli_error()  - The mysqli_error() function is used to return the error in the most recent MySQL function call that failed.

    =>  mysqli_query()-  mysqli_query() what it returns. The return value could be a boolean(true/false)

    =>  mysqli_close() - The close() / mysqli_close() function closes a previously opened database connection.


    Simply run in your favourite browser by xampp server



    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

  • PHP The switch Statement


    PHP The switch Statement


    PHP - The switch Statement



    If you want to select one of many blocks of code to be executed, use the Switch statement.

    The switch statement is used to avoid long blocks of if..elseif..else code.PHP The switch Statement


    Syntax


    switch (expression)
    {
       case label1:
          code to be executed if expression = label1;
          break;  
       
       case label2:
          code to be executed if expression = label2;
          break;
          default:
       
       code to be executed
       if expression is different 
       from both label1 and label2;

    }





    Example



    The switch statement works in an unusual way. First it evaluates given expression then seeks a lable to match the resulting value. If a matching value is found then the code associated with the matching label will be executed or if none of the lable matches then statement will execute any specified default code.








    $d = date("D");
           
             switch ($d)
    {

                case "Mon":
                   echo "Today is Monday";
                   break;
             
                case "Tue":
                   echo "Today is Tuesday";
                   break;
             
                case "Wed":
                   echo "Today is Wednesday";
                   break;
             
                case "Thu":
                   echo "Today is Thursday";
                   break;
             
                case "Fri":
                   echo "Today is Friday";
                   break;
             
                case "Sat":
                   echo "Today is Saturday";
                   break;
             
                case "Sun":
                   echo "Today is Sunday";
                   break;
             
                default:
                   echo "Wonder which day is this ?";
             }
     




    ?>



    </body>
    </html>





    Today is wednesday










    PHP - The if..ifelse...elseif Statement


    The switch statement will be explained in the next chapter. ( Click Here )



    Video on This Topic :- Soon


    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)





  • PHP decision making if else elseif statements


    PHP decision making if else elseif statements




    Conditional statements are used to perform different actions based on different condtions. The if, elseif ...else statements are used to take decision based on the different condtion.

    You can use conditional statements in your code to make your decision. In PHP we have the following conditional statements:

    • if statement - executes some code if one condition is true






    • if...else statement - executes some code if a condition is true and another code if that condition is false
    • if...elseif...else statement - executes different codes for more than two conditions
    • switch statement - selects one of many blocks of code to be executed




    PHP - The if Statement


    The if statement executes some code if one condition is true.


    Syntax

    if (condition) {
      code to be executed if condition is true;
    }



    Example 



    $b = date("H");

    if ($b < "30") 
    {

      echo "Have a good day!";


    }


    ?>



    </body>
    </html>





    Have a good day!









    PHP - The if...Else Statement


    If you want to execute some code if a condition is true and another code if a condition is false, use the if....else statement. PHP if else elseif statements


    Syntax

    if (condition)
       code to be executed if condition is true;
    else
       code to be executed if condition is false;


    Example


    The following example will output "Have a nice weekend!" if the current day is Friday, Otherwise, it will output "Have a nice day!":


    Example 



       $d = date("D");
             
             if ($d == "Mon")
    {
                echo "Have a nice vacation!"; 
             } 
             else 
    {
                echo "Have a nice day!"; 
    }  


    ?>



    </body>
    </html>




    Have a nice vacation!





    The ElseIf Statement


    If you want to execute some code if one of the several conditions are true use the elseif statement.PHP decision making if else elseif statements


    Syntax


    if (condition)
       code to be executed if condition is true;
    elseif (condition)
       code to be executed if condition is true;
    else
       code to be executed if condition is false;



    Example


    The following example will output "Have a nice weekend!" if the current day is Friday, and "Have a nice Sunday!" if the current day is Sunday. Otherwise, it will output "Have a nice day!" −



    Example 



       $d = date("D");
             
             if ($d == "Fri")
    {
                echo "Have a nice weekend!";
             }
             elseif  ($d == "Sun") {
                echo "Have a nice Sunday!"; 
             }
             else {
                echo "Have a nice day!"; 
          
      
    }

    ?>



    </body>
    </html>




    Have a nice day!




    PHP - The switch Statement


    The switch statement will be explained in the next chapter. ( link will be updated soon )



    Video on This Topic :- Soon


    I hope you liked this post, then you should not forget to share this post at all.
    Thank you so much :-)



  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.