Skip to content

Instantly share code, notes, and snippets.

View JasvinderSingh1's full-sized avatar
🤘

Jasvinder Singh JasvinderSingh1

🤘
  • Lucknow, India
View GitHub Profile
API code:
<?php
$hostname = "localhost";
$username = "id21145254_devjas";
$password = "Peter@007";
$database = "id21145254_devjas";
$mysqli = new mysqli($hostname, $username, $password, $database);
if ($mysqli->connect_error) {
@JasvinderSingh1
JasvinderSingh1 / PHP
Created October 27, 2021 11:25
PHP OTPL
// from date to date restrictions
$("#from_date").datepicker({
format: 'dd-mm-yyyy',
//minDate: new Date('02-09-2021'),
//maxDate: new Date(),
autoClose: true,
onSelect: function(dateText) {
var dateMin = $('#from_date').datepicker("getDate");
//var datee = new Date($("#from_date").val());console.log(datee);
https://blog.cloudboost.io/creating-your-first-mern-stack-application-b6604d12e4d3
https://medium.com/swlh/how-to-create-your-first-mern-mongodb-express-js-react-js-and-node-js-stack-7e8b20463e66
https://www.freecodecamp.org/news/npm-vs-npx-whats-the-difference/
npm (node package manager) is the dependency/package manager
http://localhost:3000/
@JasvinderSingh1
JasvinderSingh1 / php import from excell, csv to database
Created January 10, 2021 02:35
php import from excell, csv to database
<?php
if(isset($_POST["submit"]))
{
$url='localhost';
$username='root';
$password='';
//$conn=mysqli_connect($url,$username,$password,"location");
$conn=mysqli_connect("localhost", "euodias_dev1", "euodias_dev1@321!", "euodias_redrope");
if(!$conn){
Dowload install node
install angular CLI
ng new 'project name'
ng serve --port 4300
ng generate component 'component name'
https://jasonwatmore.com/post/2019/06/10/angular-8-user-registration-and-login-example-tutorial#login-component-html
<?php
/**
* Mini-cart
*
* Contains the markup for the mini-cart, used by the cart widget.
*
* This template can be overridden by copying it to yourtheme/woocommerce/cart/mini-cart.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
@JasvinderSingh1
JasvinderSingh1 / order-import.php
Created December 18, 2019 12:15
Custom script to import order from a different database to WooCommerce
<?php
/*
* Custom script to import order from a different database to WooCommerce
*/
function custom_import_order_shortcode_fun2(){
ob_start();
global $wpdb;
//
// $old_orders = $wpdb->get_results( "SELECT * FROM `orders` WHERE orderid BETWEEN 68980 AND 69005");
@JasvinderSingh1
JasvinderSingh1 / product-import.php
Created December 18, 2019 12:14
Custom import script for products (simple/variable) from different database to woocommerce
<?php
/*
* Custom import script for products (simple/variable) from different database to woocommerce
* custom-import-script.php
*/
//create product
function custom_import_product_shortcode_fun(){
If you want the URL rewriting as in Wordpress then PHP is the way. Here is simple example to begin with.
Folder structure
There are two files that are needed in the root folder, .htaccess and index.php, and it would be good to place the rest of the .php files in separate folder, like inc/.
root/
inc/
.htaccess
index.php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.resmush.it/ws.php?qlty=80&img=http://freetouse.com.dev.ceptiv.net/track-cover/thumb/Vlad-Gluschenko-Lean-On.jpg');
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$result = curl_error($ch);
}