Skip to content

Instantly share code, notes, and snippets.

View debojitkakoti's full-sized avatar

DEBOJIT KAKOTI debojitkakoti

View GitHub Profile
@debojitkakoti
debojitkakoti / api.php
Created January 28, 2014 10:14
Simple API in PHP to return data in JSON format
<?php
include_once 'db.php';
global $con;
define('ERROR','404');//Define Your Error message HERE
define('REQADDR', '127.0.0.1');//Define your REQUESTIN SERVER ADDR
if($_SERVER['REMOTE_ADDR']=='127.0.0.1'){
//process it
if(isset($_GET['q'])){
$q=mysql_real_escape_string($_GET['q']);//TO get rid of SQL Enjection
@debojitkakoti
debojitkakoti / db.php
Created January 28, 2014 08:27
php mysql connect
<?php
$con = mysql_connect("localhost", "root", "");
if(!$con){
die(mysql_error());
}
mysql_select_db('myconference') or die(mysql_error());
@debojitkakoti
debojitkakoti / curl_request.php
Created January 27, 2014 13:06
Simple curl request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
<?
#get_post_meta($post->ID, 'SeoHead', true)
$seo_box = 'H1 Headline: Keyword1, Keyword2, Keyword3, Keyword4, Keyword5';
$meta_values = explode(':',$seo_box);
if(isset($meta_values[1])){
$keywords = explode(',',$meta_values[1]);
$seo_box = '<ul>';
foreach($keywords as $keyword){
@debojitkakoti
debojitkakoti / whatsapp_send.php
Created January 17, 2014 11:41
whatsapp:send message
$w = new WhatsProt($userPhone, $userIdentity, $userName, $debug);
$w->Connect();
$w->LoginWithPassword($password);
$w->sendMessage($destinationPhone_new, $msgbody);//Send Message Here
{{Form::open(array('url'=>'/login'))}}
{{ Form::email('email', $value = null, $attributes = array())}}
{{ Form::password('password', $value = null, $attributes = array())}}
{{ Form::submit('Login', $attributes = array('class'=>'button tiny radius'))}}
{{Form::close()}}