Posts

Showing posts from May, 2017

woocommerse product category

<div id="allcategories" style="display:none;"><div id="all_pro_cat" style="display:none;"><ul><?php wp_list_categories( 'show_count=0&hierarchical=1&taxonomy=product_cat&depth=2&title_li=' ); ?></ul></div></div>'; output : <ul> <li class="cat-item cat-item-112"><a href="https://OnlineStore/product-category/container-components/">Container Components</a> <span class="toggle"></span><ul class="children">  <li class="cat-item cat-item-183"><a href="https://OnlineStore/product-category/container-components/capseal-tools/">Capseal Tools</a> </li>  <li class="cat-item cat-item-185"><a href="https://OnlineStore/product-category/container-components/capseals/">Capseals</a> </li>  <li class="cat-item

Links

For Temp email https://temp-mail.org/ ------------------------------------------------ Temp SMS https://play.google.com/store/apps/details?id=com.gogii.textplus&hl=en https://itunes.apple.com/us/app/textplus-unlimited-sms-texting-calling/id314487667?mt=8 ---------------------------------------------------------------------------------------------------------- Permanent Personal Computer https://www.rabb.it/ ------------------------------------------------------------------ Temp RDP (Remote Desktop) https://www.apponfly.com ------------------------------------------------------ 24 Hours RDP (Remote Desktop) https://vmware.nvidiagrid.net/ -------------------------------------------- Light Weight Text Editor Sublime Text (google the link) ---------------------------------------------- Change your IP using VPN http://www.freevpnnetwork.com/ ----------------------------------------------------- free proxy servers http://free-proxy-list.net/anonymo

php unzip

$zip = new ZipArchive; $res = $zip->open('xyz.zip'); if ($res === TRUE) {   $zip->extractTo('/');   $zip->close();   echo 'done'; } else {   echo 'error'; }

php scrapping

function file_get_contents_curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);       $data = curl_exec($ch); curl_close($ch); return $data; } $htmldata = file_get_contents_curl('http://bascousa.com/kraft-self-seal-bubble-mailers-bmb857ss.html'); $error = false; if($htmldata){ $domdocument= new DOMDocument; $internalErrors = libxml_use_internal_errors(true); $domdocument->loadHTML($htmldata); libxml_clear_errors(); //remove errors for yucky html $readhtml_xpath = new DOMXPath($domdocument); $name = array(); $articlename       =   $readhtml_xpath->query('//div[contains(@id,"content_features")]/div'); if($articlename->length > 0 && !$error){ foreac

php putcsv

$list = array ( "Peter,Griffin,Oslo,Norway", "Glenn,Quagmire,Oslo,Norway", ); $file = fopen("contacts.csv","w"); foreach ($list as $line)   {   fputcsv($file,explode(',',$line));   } fclose($file);

php imagedata

$image = 'http://www.writephponline.com/assets/images/facebook.png'; echo $imageData = base64_encode(file_get_contents($image)); die; $src = 'data: '.mime_content_type($image).';base64,'.$imageData; echo '<img src="', $src, '">';

php ftp

$conn_id = ftp_connect('example.com'); if(!$conn_id){ echo 'connection error.'; } // login with username and password echo $login_result = ftp_login($conn_id, 'username', 'password'); echo '<br>'; // upload a file

DB class

class DB { public $tableName = 'videos'; function __construct($dbHost,$dbUsername,$dbPassword,$dbName){ // Connect database $conn = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName); if($conn->connect_error){ die("Failed to connect with MySQL: " . $conn->connect_error); }else{ $this->db = $conn; } } function getRecord($table,$where=array()){ $sql = "SELECT * FROM $table Where 1=1"; if(!empty($where)){ foreach($where as $key=>$val){ $sql .=$key." = '".$val."'"; } } $query = $this->db->query($sql); $result = $query->fetch_all(); if($result){ return $result; }else{ return false; } } function getSingleRecord($table,$where=array()){ $sql = "SELECT * FROM $table Where 1=1"; if(!empty($where)){ foreach($where as $key=>$val){ $sql .=$key." = '".$val."'"; } }

Booking API for goibibo

class Booking_api { private $app_id; private $app_key;     function __construct() { $this->app_id = 'Your APP ID'; $this->app_key = 'APP Key';     }             function SearchFlight($param = false) {       $param['app_id'] = $this->app_id;       $param['app_key'] = $this->app_key;       $param['format'] = 'json';       $param['counter'] = '100';       if(empty($param['source'])){  return $this->error('Please Enter source');  }  if(empty($param['destination'])){  return $this->error('Please Enter destination');  }  if(empty($param['dateofdeparture'])){  return $this->error('Please Enter dateofdeparture');  }  if(empty($param['seatingclass'])){  return $this->error('Please Enter seatingclass');  }    if(empty($param['adults'])){  return $this->er