Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

36 Program to update data in MySQL Database using PHP.

Program: <?php     $host = "localhost";     $user = "root";     $pass = "1234";     $dbname = "...
Read More

35 Program to display data from MySQL Database in PHP.

Program: <?php     $host = "localhost";     $user = "root";     $pass = "1234";     $dbname = ...
Read More

34 Program to Insert Data in MySQL Database using PHP

Database: 1) CREATE DATABASE EMPLOYEES; 2) USE EMPLOYEES; 3) CREATE table emp(id int PRIMARY KEY,name Varchar(20),Salary Integer); Pro...
Read More

33 Program to connect PHP with MySQL Database using PDO::__construct().

Program: <?php     $host = "localhost";     $user = "root";     $pass = "1234";         try     { ...
Read More

32 Program to connect PHP with MySQL Database using mysqli_connect().

Program: <?php     $host = "localhost";     $user = "root";     $pass = "1234";         $conn = my...
Read More

31 Program to Destroy Session in PHP

Program: <?php     session_start();     // Destroy Session Variable     session_unset();     // Destroy Session     session_d...
Read More

30 Program to Get Session Variables in PHP.

Program: <?php     session_start();     $_SESSION["favcolor"] = "green";     $_SESSION["favanimal"]...
Read More

29 Program to start session in PHP

Program: <?php     session_start();     $_SESSION["favcolor"] = "green";     $_SESSION["favanimal"]...
Read More

28 Program to delete cookies in PHP

Program: <?php         setcookie("name",null,time()-3600);     // Set the expiration time 1 hour ago     echo "Cook...
Read More

27 Program to modify cookies in PHP

To modify cookie, just set(again) the cookie using the setcookie() function. Program: <?php     $cookie_name = "Name"; ...
Read More

26 Program to create Cookies in PHP

Program: <?php     $cookie_name = "Name";     $cookie_value = "Atharva";     setcookie($cookie_name,$cookie_v...
Read More

25 Program to demonstrate Server Role in PHP

Program: <html> <body>     <?php         if(date('G')<12)             echo "Good Morning ".date...
Read More

24 Program to demonstrate Web Page Validation in PHP

Program: <?php     if(isset($_POST['submit']))     {         $username = $_POST['username'];         $pass = $_POS...
Read More

23 Program to demonstrate Serialization in PHP

Program: <?php     class Customer     {         private $name;         private $credit;                 public function __constru...
Read More

22 Program to demonstrate clonning of object in PHP

Program: <?php         class CloneDemo     {         public $data1;         public $data2;         public $data3;     }    ...
Read More

21 Program to demonstrate method overriding in PHP

Program: <?php         class Childs     {         function func()         {             echo "Child Class <br>"...
Read More

20 Program to demonstrate Method Overloading in PHP.

Program: <?php     class Addition     {                 function __call($name_of_function, $arg)         {             if($na...
Read More

19 Program to demonstrate Inheritance in PHP

Program: <?php     class Person     {         var $name,$age;                 function set($name,$age)         {             $...
Read More

18 Program to demonstrate Constructor in PHP.

Program: <?php     class Student     {         protected  $roll_no;         protected  $name;               function __construct...
Read More

17 Program to demonstrate classes and objects in PHP

Program: <?php     class Student     {          public  $roll_no;          public  $name;                 function display()    ...
Read More