djdj - HTMLify profile

djdj's Profile Picture

djdj

471 Files

103208 Views

Latest files of /djdj/php/Programs

Programs/ djdj/php/Programs/Programs/
35 Items
  • Form.php
  • Require-Include.php
  • Data-Types.php
  • Operator.php
  • Foreach-Loop.php
  • Scope-Local-Global-Variable.php
  • Add-Two-No.php
  • Displaying-Data.php
  • Delete-The-Record.php djdj/php/Programs/Delete-The-Record.php
    388 Views
    0 Comments
    <?php

    // Connecting to the Db
    $servername = "localhost";
    $username = "root";
    $password = "";
    $database = "form";

    Form.php djdj/php/Programs/Form.php
    436 Views
    0 Comments
    <!doctype html>
    <html lang="en">
    <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    Data-Types.php djdj/php/Programs/Data-Types.php
    392 Views
    0 Comments
    <?php
    $name = "Dj"; //String
    $salary = 5000000; //Interger
    $experience = 1.5; //Float
    $bonus = "50.25k";//Decimal
    $bollean = true; //Bollean (true or false)
    $friends = array('Shubh','ABH','Mohit','Happy','TK');

    Operator.php djdj/php/Programs/Operator.php
    360 Views
    0 Comments
    <?php
    /*Operators
    1. Arithmetic Operator
    2. Assignment Operator
    3. Comparison Operator
    4. Logical Operator
    */
    $a = 10;
    Foreach-Loop.php djdj/php/Programs/Foreach-Loop.php
    370 Views
    0 Comments
    <?php
    // foreach loop in php
    $arr = array('Apple','Banana','Grapes','Mango');

    //this is a simply a for loop that use to print an value of array
    for($i = 0; $i < count($arr); $i++){
    echo $arr[$i]. "\n";
    }
    Scope-Local-Global-Variable.php djdj/php/Programs/Scope-Local-Global-Variable.php
    380 Views
    0 Comments
    <?php
    $a = 50; // Global Variable

    function paste(){
    $a = 10; // Local Variable
    echo $a. "\n";
    global $a;
    echo $a;
    Add-Two-No.php djdj/php/Programs/Add-Two-No.php
    310 Views
    0 Comments
    <?PhP
    // php is case insensitive programming lang.
    //with three variable
    $a = 10;
    $b = 5;
    $c = $a + $b;
    EcHo ($c);

    Displaying-Data.php djdj/php/Programs/Displaying-Data.php
    370 Views
    0 Comments
    <?php

    // Connecting to the Db
    $servername = "localhost";
    $username = "root";
    $password = "";
    $database = "form";

    For-Loop.php djdj/php/Programs/For-Loop.php
    353 Views
    0 Comments
    <?php
    //for loop
    for ($i=0; $i <= 10; $i++) {
    echo $i;
    }
    ?>
    MySQL-Table.php djdj/php/Programs/MySQL-Table.php
    374 Views
    0 Comments
    <?php

    //for connection to database
    $servername = "localhost";
    $username = "root";
    $password = "";
    $database = "sabkacode";

    Create-some-new.php djdj/php/Programs/Create-some-new.php
    537 Views
    0 Comments
    <?php

    $add = false;
    $update = false;
    $delete = false;
    // Connecting to the Db
    $servername = "localhost";
    $username = "root";
    Variable.php djdj/php/Programs/Variable.php
    337 Views
    0 Comments
    <?php
    $name = "Dj";
    echo "This is $name";

    /*
    1. start with a $ sign.
    2. cannot satrt with a number.
    3. must start with a letter or an-underscore char.
    Hello.php djdj/php/Programs/Hello-World.php
    372 Views
    0 Comments
    <?php
    echo "Hello World!";
    ?>


    <!--
    For embedding/use PHP we have to use <?php ?>
    all the php code will goes within the <?php /*code*/ ?>
    do-while-loop.php djdj/php/Programs/do-while-loop.php
    356 Views
    0 Comments
    <?php
    //do while loop
    $a = 0;
    do {
    echo $a;
    $a++;
    } while ($a <= 10);
    ?>
    MySQL-Databases-Connection.php djdj/php/Programs/MySQL-Databases-Connection.php
    367 Views
    0 Comments
    <?php
    //Database Connection

    /*There are two ways to connect to My SQL Database
    1. MySQLi extension (for use only mysql db)
    2. PDO (for use any db)
    */

    While-loop.php djdj/php/Programs/While-loop.php
    363 Views
    0 Comments
    <?php
    //while loop
    $i = 1;
    while($i<=10){
    echo $i. "\n";
    $i++;
    }
    ?>
    Function.php djdj/php/Programs/Function.php
    351 Views
    0 Comments
    <?php
    //Function in php
    $ram = [90, 88, 85, 95, 91];
    $sum = marks($ram); // function call
    $ave = avera($ram);// again call function
    echo "Total marks scored by Ram out of 500 is: $sum";
    echo "\nAverage of Ram marks is: $ave";

    MySqL-Database.php djdj/php/Programs/MySqL-Database.php
    365 Views
    0 Comments
    <?php

    //for connection to database
    $servername = "localhost";
    $username = "root";
    $password = "";

    //create connection
    Post-Method.php djdj/php/Programs/Post-Method.php
    409 Views
    0 Comments
    <?php
    if($_SERVER['REQUEST_METHOD'] == 'POST'){//if (isset($_POST)){
    $name = $_POST['name'];
    $email = $_POST['email'];

    echo "welcome" .$name ."". $email;
    }
    ?>
    Update-Data-Where-Clause.php djdj/php/Programs/Update-Data-Where-Clause.php
    360 Views
    0 Comments
    <?php

    // Connecting to the Db
    $servername = "localhost";
    $username = "root";
    $password = "";
    $database = "form";

    String.php djdj/php/Programs/String.php
    351 Views
    0 Comments
    <?php

    $name = 'SabkaCode';
    echo $name; //simple print name
    echo "\n";
    echo "The length of string ".strlen($name)."\n"; // print the length of the string
    echo "The reverse string is ".strrev($name)."\n"; //print the string in reverse
    echo "The position of a character is ".strpos($name,"e")."\n";// print the position of that char that you write there and search
    Dates.php djdj/php/Programs/Dates.php
    370 Views
    0 Comments
    <?php
    //dates in php

    echo date("d"). "\n"; //Print date of today : 24
    echo date("j"). "\n"; //Print date of today : 24
    echo date("l"). "\n"; //Print day of today : Saturday
    echo date("D"). "\n"; //Print day of today : Sat
    echo date("S"). "\n"; //Print th of today : TH
    Associative-Array.php djdj/php/Programs/Associative-Array.php
    383 Views
    0 Comments
    <?php
    //Numeric Array or Index Array
    $arr = array('ram','shiv','kumar','arjun');

    echo $arr[0];
    echo $arr[1];
    //using array for loop
    for($i = 0; $i < count($arr); $i++){
    Switch-Case.php djdj/php/Programs/Switch-Case.php
    386 Views
    0 Comments
    <?php
    $age = 30;
    switch($age){
    case 18:
    echo "You are eligible for vote\n";
    break;
    case 12:
    echo "your age is 12\n";
    Simple-Print.php djdj/php/Programs/Simple-Print.php
    350 Views
    0 Comments
    <?php
    echo 'hello dj';
    ?>
    If-else.php djdj/php/Programs/If-else.php
    373 Views
    0 Comments
    <?php
    $a = 5;
    $b = 2000;
    $c = 2016;

    if($a > 2){
    echo "a is greater than 2\n";
    }
    Insert-Data-In-Table.php djdj/php/Programs/Insert-Data-In-Table.php
    335 Views
    0 Comments
    <?php

    //for connection to database
    $servername = "localhost";
    $username = "root";
    $password = "";
    $database = "sabkacode"; //already created db

    Get-Method.php djdj/php/Programs/Get-Method.php
    346 Views
    0 Comments
    <?php
    if($_SERVER['REQUEST_METHOD'] == 'GET'){//if (isset($_GET)){
    $name = $_GET['name'];
    $email = $_GET['email'];

    echo "welcome" .$name ."". $email;
    }
    ?>
    Multi-Dieminsion-Array.php djdj/php/Programs/Multi-Dieminsion-Array.php
    364 Views
    0 Comments
    <?php
    //Multi Dieminsion Array
    $md = array(
    array(2,5,7,8),
    array(1,2,3,1),
    array(5,6,7,2));

    echo var_dump($md); //for simple see thae array it gives all values of array
    Require-Include.php djdj/php/Programs/Require-Include.php
    349 Views
    0 Comments
    <?php

    echo"Include:<br>";
    //include
    include 'MySQL-Databases-Connection.php'; //include will only produce a warning (E_WARNING) and the script will continue

    $sql = "SELECT * FROM `details` ";
    $result = mysqli_query($conn, $sql);
    Files.php djdj/php/Programs/Files.php
    366 Views
    0 Comments
    <?php
    //for read the file
    readfile('yoursfile.txt'); //for only read the file
    echo readfile('yoursfile.txt'); //for read the file and print how many word in the file

    //fopen - is used to open the file
    //fread - is used to read the file
    //fclose - is used to close the file
    yoursfile.txt djdj/php/Programs/yoursfile.txt
    317 Views
    0 Comments
    this is testing file create