Skip to main content

Posts

Showing posts from 2017

apache_lookup_uri() in php

<?php echo "<pre>"; $info = apache_lookup_uri('index.php?var=value'); print_r($info); if (file_exists($info->filename)) {     echo 'file exists!'; } ?> output:- stdClass Object ( [status] => 200 [the_request] => GET /php/s/1 HTTP/1.1 [method] => GET [mtime] => 0 [clength] => 0 [chunked] => 0 [content_type] => text/html [handler] => application/x-httpd-php [no_cache] => 0 [no_local_copy] => 1 [unparsed_uri] => /php/s/index.php?var=value [uri] => /php/s/index.php [filename] => C:/xampp/htdocs/php/s/index.php [args] => var=value [allowed] => 0 [sent_bodyct] => 0 [bytes_sent] => 0 [request_time] => 1513669009 ) file exists!

view All $_SERVER and globale variable in php.

view All $_SERVER  and globale  variable  in php. echo '<table cellpadding="10">' ; foreach ($_SERVER as $arg => $value ) {             echo '<tr><td>$_SERVER["'.$arg.'"] = </td><td>' . $value. '</td></tr>' ;     } echo '</table>' ;                                                            output                                                                              $_SERVER["MIBDIRS"] = C:/xampp/php/extras/mibs $_SERVER["MYSQL_HOME"] = \xampp\mysql\bin $_SERVER["OPENSSL_CONF"] = C:/xampp/apache/bin/openssl.cnf $...

Export Mysql database to csv file

Export Mysql database to  csv file       $connect = mysqli_connect("localhost", "root", "", "test");       header('Content-Type: text/csv; charset=utf-8');       header('Content-Disposition: attachment; filename=data.csv');       $output = fopen("php://output", "w");       fputcsv($output, array('ID', 'Page Title', 'Page Url'));       $query = "SELECT * FROM `page`";       $result = mysqli_query($connect, $query);       while($row = mysqli_fetch_assoc($result))       {            fputcsv($output, $row);       }       fclose($output);  
Create  dynamic sitemap  from MySQL database with php   -- -- Database: `test` -- -- -------------------------------------------------------- -- -- Table structure for table `page` -- CREATE TABLE IF NOT EXISTS `page` (   `page_id` int(11) NOT NULL,   `page_title` text NOT NULL,   `page_url` text NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; -- -- Dumping data for table `page` -- INSERT INTO `page` (`page_id`, `page_title`, `page_url`) VALUES (1, 'JSON - Dynamic Dependent Dropdown List using Jquery and Ajax', 'json-dynamic-dependent-dropdown-list-using-jquery-and-ajax'), (2, 'Live Table Data Edit Delete using Tabledit Plugin in PHP', 'live-table-data-edit-delete-using-tabledit-plugin-in-php'), (3, 'Create Treeview with Bootstrap Treeview Ajax JQuery in PHP\r\n', 'create-treeview-with-bootstrap-treeview-ajax-jquery-in-php'), (4, 'Bootstrap Multiselect Dropdown with Checkboxes using Jquery in PHP\r\n', 'boo...

Create Json code from MySQL database with php

Create Json code  from MySQL database with php   -- -- Database: `test` -- -- -------------------------------------------------------- -- -- Table structure for table `page` -- CREATE TABLE IF NOT EXISTS `page` (   `page_id` int(11) NOT NULL,   `page_title` text NOT NULL,   `page_url` text NOT NULL ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; -- -- Dumping data for table `page` -- INSERT INTO `page` (`page_id`, `page_title`, `page_url`) VALUES (1, 'JSON - Dynamic Dependent Dropdown List using Jquery and Ajax', 'json-dynamic-dependent-dropdown-list-using-jquery-and-ajax'), (2, 'Live Table Data Edit Delete using Tabledit Plugin in PHP', 'live-table-data-edit-delete-using-tabledit-plugin-in-php'), (3, 'Create Treeview with Bootstrap Treeview Ajax JQuery in PHP\r\n', 'create-treeview-with-bootstrap-treeview-ajax-jquery-in-php'), (4, 'Bootstrap Multiselect Dropdown with Checkboxes using Jquery in PH...

CRUD Using Php with Ajax

CRUD Using  Php with  Ajax (index.php) <?php  include('row.php');?> <!DOCTYPE html> <html lang="en"> <head>   <title>Bootstrap Example</title>   <meta charset="utf-8">   <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" href="asset/bootstrap.min.css">   <script src="asset/jquery.min.js"></script>   <script src="asset/bootstrap.min.js"></script> </head> <body> <div class="container">     <div class="row">        <div class="alert" role="alert">                  </div>               <div class="col-md-10 col-md-offset-1">             <div class="panel panel-default panel-table">          ...

Wordpress card pluging (best practice)

<?php /* Plugin Name: My form */ $my_option= get_option('myformSetting'); function my_admin_theme_style() {     wp_enqueue_style('my-admin-theme', plugins_url('wp-admin.css', __FILE__)); } add_action('admin_enqueue_scripts', 'my_admin_theme_style'); add_action('login_enqueue_scripts', 'my_admin_theme_style'); add_action('admin_menu', 'my_menu_pages'); function my_menu_pages(){     add_menu_page('My Page Title', 'My Menu Title', 'manage_options', 'my-menu', 'my_menu_output' );     add_submenu_page('my-menu', 'Submenu Page Title', 'Whatever You Want', 'manage_options', 'my_menu','my_menu' );     add_submenu_page('my-menu', 'Submenu Page Title2', 'Whatever You Want2', 'manage_options', 'my_menu2','my_menu2' ); } function register_mysettings() { // whitelist opti...

__call magig method with multiple classes

<?php  /**  *  */  class address  {   public $address=" ramnager";   function getAddress( )   {   return $this->address;   }  }  /**  *  */  class name extends address  {   private $firstName="Saddam";   private $lastName="Hussain";   public function getfisrtName()   {   return $this->firstName;   }   public function lastName($value='')   {   return $this->lastName;   }   public function fullName($value='')   {   return " ".$this->firstName." ".$this->lastName;   }  }  /**  *  */  class role  {   private $role =" admin";   public function getRole()   {   return $this->role;   }  }  /**  *  */  class user  {   protected $newClass;   protected...

how print multiple methods function in oops php

how print multiple methods function in oops php  $a=new HTMLImage(); $newObject=new WebsiteLogo($a); echo $newObject->getSource()->FunctionName()->getName(); ______________________________________________________ class test  {      function __construct( )    {      # code...    }    public function getName()    {       echo "hello dear! my name is saddam hussain saifi";    }  } /** * */ class redme {     function __construct( )   {     # code...   }   public function FunctionName()   {     # code...     return new  test;   } } class HTMLImage {   function __construct()   {       }   public function getSource()   {     return new redme();   }   } class WebsiteLogo {   private $img;  ...

how create pdf file in html or php using dompdf | dompdf how to use | dom pdf tutorial | dom pdf tutorial in core php

how create pdf file  in html or php using dompdf | dompdf how to use | dom pdf  tutorial  | dom pdf  tutorial  in core php   <?php /* dom pdf tutrial dom download dompdf use this command in cmd: - composer require dompdf/dompdf    */ include("vendor/autoload.php"); use Dompdf\Dompdf; $dompdf = new Dompdf(); $array=["Name"=>"Saddam hussain","company"=>"Spinks india pvt. ltd.","designation"=>"php webdeveloper","youtube"=>'http://localhost/php/dompdf/']; $data='<table style="width: 100%;" border="1" cellpadding="3"> <tbody>'; foreach ($array as $key => $value) { $data.='<tr> <td style="width: 13.9793%;">'.$key.'</td> <td style="width: 85.0207%;">'.$value.'</td> </tr>'; } $data.='</tbody> </table> ...

Spinks world laser and pad printing machine

Spinks world laser and pad printing machine Pad printing machines and laser marking machines manufacturers in India Pad printing machines and laser marking machines manufacturers in India Tampoprint pad printing machines in India, Spinks India pad printing machines Pad printing and laser marking machines manufacturer in India Pad printing and laser marking machines manufacturer in India Pad printing and laser marking machines manufacturer in India Pad printing machines and inks manufacturers in India Pad printing and laser marking machines manufacturer in India Pad printing and laser marking machines manufacturer in India Pad printing machines video, laser marking machines video Pad printing machines video, laser marking machines video Pad printing machines video, laser marking machines video RUCO Glass printing inks, Glass Pad Printing inks, Glass Printing inks, RUCO inks, decorative glass printing inks- Spinks India glass inks Tampoprint pad printing machines, P...