Skip to main content

Posts

Showing posts matching the search for php

How to create theme in wordpress application by scratch

How To create a theme in WordPress we will follow the following step:- create folder under wp-content/themes/folder and create these files 1 Create a header.php file </header> 2 Create a footer.php file <footer> </footer> </body> </html> 3 create index.php <?php get_header(); ?> <section> </section> <?php get_footer(); ?> 4 create style,css define header, footer, and middle properties 5 link style.css file under header.php <link href="<?php get_template_directory_uri(); ?>/style.css" type="text/css" rel="stylesheet" /> ......................................................................................................................................... Complete Code For Theme Development:- header.php ...................................................... <!DOCTYPE html> <html> <head> <title></title> <link re...

PHP Introduction, What is PHP?, Scope of PHP

PHP means a Personal Home Page, It is a server-side script-based language that is specially designed to create a dynamic web application. but now PHP is professionally known as Hypertext preprocessor. Hypertext:-  PHP provide text within tag with a complete block that is Hypertext block . <?php ?> here <?   ?> is called Hypetext block Preprocessor:-  All in-built or predefined functionality will be integrated by default under PHP Hypertext block, no need to import header files and library separately. The server-side script will be executed by Web Server and communicate with the Database server for dynamic application development. For example, PHP is a Server-side script which will be executed by Apache Server and communicate with MYSQL Database , Oracle Database , MS-SQL , MongoDB, PostgreSQL , etc PHP is open-source and free source web technology that provides multiple Web Framework( Codeigniter, Laravel, YI, CakePHP, etc ) and CMS ( Content Manageme...

Create Widget Plugin in WordPress

Create Widget Plugin in WordPress:- It is a special plugin of word press which will be displayed under the widget section. it will be written in the oop's pattern. PHP provide wp_widget class to define widget. <?php /* plugin name:- Mywidget description:-  it is for scs events description version: 1.0 Author:  shiva Author Uri:  www.shivaconceptsotuion.com */ class MyWidget extends WP_Widget {    function __construct()    {       parent::__construct('MYwidget', __( 'MY Widget'), array( 'customize_selective_refresh' => true, ) );    }     function form($instance)     {       $defaults = array( 'title'    => '', ); // Parse current settings with defaults extract( wp_parse_args( ( array ) $instance, $defaults ) );     ?>     <p> <label>Enter Title</label> <input cl...

What is Include,Require,Include once and Require once in PHP?

Include and Include once:-  It is used to include the content of one PHP file to another PHP file, if the file not found then it will provide a warning and show the remaining data. If we include the same file multiple times then include will display multiple results but include_once will show single result. for example, if we create a.php file and echo "hello world" then if we include this file into b.php three times then it will display "hello world" three times but include_once will display "hello world" only once. Example of include PHP:- a.php code <?php echo "hello world"; ?> b.php  <?php rinclude("a.php"); include("a.php"); ?> output helloworld helloworld Example of includeonce PHP:- a.php code <?php echo "hello world"; ?> b.php  <?php rinclude_once("a.php"); include_once("a.php"); ?> output helloworld Require and Require once: -  It is used to include the conten...

How to create a page using View file and Controller class

How to create a website using View file and Controller class:-  1   Create a Controller and define five different Method <?php class Guest extends CI_Controller {     function index()     {        $this->load->view('header');        $this->load->view('home');        $this->load->view('footer');     }     function about()     {        $this->load->view('header');        $this->load->view('about');        $this->load->view('footer');     }     function service()     {        $this->load->view('header');        $this->load->view('service');        $this->load->view('footer');     }     function gallery()    ...

CORE PHP Interview Question

PHP Interview Question If you read it then sure you can crack interview ,this session is also available on my YOU-TUBE CHANNEL or go www.shivatutorials.com 1)What is difference between echo and print? 2)What is  difference between ' ' and " " in PHP? 3)What is Super Global Variable in PHP? 4)What is Constant declaration in PHP? 5)What is Difference between Index Array ,Associative Array and Mixed array in PHP? 6)Write the name of five datatype function? 7)Write the name of five String function? 8)What is implode and explode function in PHP? 9)What is Curl and PEAR in PHP? 10)What json_encode and json_decode() in PHP? 11)What is implode and explode() in PHP? 12)How we can upload multiple files in PHP ? 13)Write the query to update and insert record into database ? 14)Write the query to check email id already exist with complete PHP Code? 15)What is difference between mysql and mysqli? 16)What is mysqli_fecth_row and mysqli_fetch_array()? 17)What is Ajax explain  AJAX ...

Create First Program of PHP,How to create first program using PHP

1) Download PHP Software Tools:-     1.1) XAMPP Serve r:-   It provides Apache Web Server, MYSQL Database Server, PHP Script, and Pearl Script. It is common for all operating systems (Windows, Linux, MAC, Solaris, Unix, Android)    X----> ANY    A ---->  Apache    M ----> MYSQL    P-----> Pearl    P------> PHP 1.2) WAMP, LAMP, MAMP is the other software tools of PHP      WAMP is specially for  Windows (W--Windows,A--> Apache,M--> MYSQL,P-->PHP)      LAMP  is specially for LINUX   (L--> LINUX,A---> Apache,M--> MYSQL,P-->PHP)      MAMP is specially for MAC      (M-->MAC,A--> Apache,M-->MYSQL,P---> PHP) download xampp from this link https://www.apachefriends.org/download.html 2)  Open XAMPP Control Panel:-       Click on the Desktop xampp icon  and click on...

Create Select ,Update and Delete Record using PHP

First Create Table View to display records similar to my previous article. View Student Record Rno Sname Branch Fees 1001 jaykumar awasthi CS 85000 Edit Delete 1002 manish CS 56000 Edit Delete 1003 jay CS 56000 Edit Delete Are you sure you want to update the record RNO NAME BRANCH FEES BACK to show record Are you sure you want to delete the record RNO NAME BRANCH FEES BACK Step1st:- View Record Code in PHP:- Create Table first using PHPmyadmin of Student with four-column (rno,sname, branch, fees) Create HTML View using viewrecord.php <!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> table { width:600px; } table th { background-color:yellow; color:blue; font-size: 25px; }         table td { background-color:orange; color:black; font-size: 20px; text-align: center; } </style> </head> <body> ...

Ajax in PHP

Ajax means asynchronous javascript and XML , it is used to partially update the content of web page excluding complete page means if we want to submit particular content of web forms then we can use ajax programming. google search engine is the best example of ajax when we press any key then respective data will be populated under text filed. Asynchronous means , if we perform operation simultaneously then it is called asynchronous. JavaScript or Jquery is used to handle an event of ajax form component. XML is used to send a request to the web server and get a response from the webserver. Xml use XMLHttpRequest object for request and XMLHttpResponse Object for response. ....................................................................................................................................... Program of Ajax:- Now we are creating an autosuggestion box using ajax means when the user will press s char then the respective data of s char  will be populated. Create Desig...

Cookie Concept in PHP

It is used to store application data in the client machine under a web browser. the browser contains a cookies folder by default .if we create a cookie in an application then it will automatically store information. A cookie is used to provide variable state management options using a specific browser. Every browser has a separate cookie folder for example if we open a chrome browser and create cookie data then it will store data under a chrome browser cookie. A cookie is used to create remember me , bookmark option in the browser. When we create a session then by default session data will be stored under the browser cookie. the session will be global because it will be created by the server-side and the cookie will be local or private because it will be created by the browser and store under the browser using the local memory of the system. Syntax of Set cookie:- setcookie('key','value',time); Syntax of getting cookie:- echo $_COOKIE['key']; when we not provide...

Cart Library in Codeigniter

Using this we can create Shopping cart features in an application. CI Provide cart library to implement this functionality. Step to Implement Card Functionality:- 1)  Create Controller 2 ) Load cart library under Controller Constructor $this->load->library('cart') 3) Create Controller  Index method and Add Multiple Items into cart 4) Create View  and show cart content Complete Code of Cart:- <?php class Shoppingcart extends CI_Controller {  function __construct()  {   parent::__construct();   $this->load->library('cart');     }      function index()      {       $this->cart->destroy();        $data = array(         array(                 'id'      => 'sku_123ABC',         ...