Skip to content

Instantly share code, notes, and snippets.

View harendra21's full-sized avatar
🏠
Working from home

Harendra Kumar Kanojiya harendra21

🏠
Working from home
View GitHub Profile
<html lang="en">
<head>
<title>PHP and jQuery - Crop Image and Upload using Croppie plugin</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.2/croppie.min.css">
<link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.2/croppie.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/js/bootstrap.min.js"></script>
<style type="text/css">
<?php
$image = $_POST['image'];
list($type, $image) = explode(';',$image);
list(, $image) = explode(',',$image);
$image = base64_decode($image);
$image_name = substr($_POST['imageName'],12,2000);
file_put_contents('uploads/'.$image_name, $image);
echo 'successfully uploaded';
?>
@harendra21
harendra21 / file-upload-form.html
Created June 16, 2020 17:38
file-upload-form
<!DOCTYPE html>
<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
var app = angular.module('myApp', ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "home.html",controller : "homeCtrl"
})
.when("/about", {
template : "<h1>Harendra <br> +91-9559058446</h1>"
})
<h1>Home Page</h1>
{{ data }}
{
"name": "routing",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Angular Router</title>
</head>
<body ng-app="myApp">
<a href="/">Home</a> |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat App</title>
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="./css/style.css">
</head>
<body ng-app="myApp">
body,html{
height: 100%;
margin: 0;
background: #7F7FD5;
background: -webkit-linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
background: linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
}
.chat{
margin-top: auto;
var app = angular.module("myApp", []);
var conn = new WebSocket('ws://localhost:8081');
app.controller('appCtrl', function($scope) {
$scope.onlineUsers = [];
$scope.loggedInUser = null;
$scope.isUserLoggedIn = false;
$scope.userName = null;
$scope.toUser = null;