Posts

Showing posts from June, 2016

Login with google plus

<html lang="en"> <head> <meta name="google-signin-scope" content="profile email"> <meta name="google-signin-client_id" content="44813260673-o4ubmoa9vg5mm62mumthfulmonnj1198.apps.googleusercontent.com"> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta charset="utf-8"> <script> function onSignIn(googleUser) { // Useful data for your client-side scripts: var profile = googleUser.getBasicProfile(); console.log("ID: " + profile.getId()); // Don't send this directly to your server! console.log('Full Name: ' + profile.getName()); console.log('Given Name: ' + profile.getGivenName()); console.log('Family Name: ' + profile.getFamilyName()); console.log("Image URL: " + profile.getImageUrl()); console.log("Email: &

Scrape the data in PHP

How to Scrape the data form website using CURL? To scrap the data from website, Website must be public and open for scrapable. In the following code, just update the URL to which websites data you want to scrap. <?php $s = curl_init(); curl_setopt($s,CURLOPT_URL,"http://www.domain_name.com/"); curl_setopt($s,CURLOPT_RETURNTRANSFER,1); curl_setopt($s,CURLOPT_HEADER,0); $op = curl_exec($s); curl_close($s); echo $op; ?>

File upload using ajax in php

upload.php   <!DOCTYPE html> <html> <head> <title>Image Upload Form</title> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript"> function submitForm() { console.log("submit event"); var fd = new FormData(document.getElementById("fileinfo")); fd.append("label", "WEBUPLOAD"); $.ajax({ url: "www.stcodewriter.com/get_upload.php", //put your get file path here type: "POST", data: fd, processData: false, // tell jQuery not to process the data contentType: false // tell jQuery not to set contentType }).done(function( data ) { console.log("Output:"); console.log( data ); }); return false; } </script> </head> <body> &l