Tuesday, July 12, 2016

SMS GATEWAY INTEGRATION IN PHP

How to Send Sms through sms gateway using php

First of all you need details of your sms gateway
i.e

  • sms gateway url
  • username 
  • password
  • 'type // default set as TEXT
  • sender //senderid to be approved from sms provider
these information will be provided by your SMS gateway provider.

once you get these details you can now send sms using php 

First configure mobile to send sms and content of sms,

$qs="&mobile=".$mobilenum."&message=".urlencode($smscontent)."";

Now make a URL which used to send sms and concat the string to url as below

$url="http://your-sms-gateway-link/sendsms.php?username=yourusername&password=yourpassword&type=TEXT&sender=SENDERID".$qs;

Now using CURL send sms


function firecurl($u){
        $curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $u);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HEADER, false);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}

// fire sms

$sendsms = firecurl($url);

That's All
Thanks

Monday, July 11, 2016

How to Move Wordpress site from Local to Live ??

We all make website in our local servers generally we find more difficulty in making site Live.

Lets Say a wordpress website on a local machine is ready and to be moved on live server,What will we do ??

First of all take backup of both database and source code in your PC

- Then upload the source code to live server

- Create Database

-Now before importing your database file  make some correction in the file

Find table "wp_options"

in this table find option_name = 'siteurl' and option_name='home'



Edit the values of both the records to your live server links

update the table

That's it.

Now you are half-way from task completion

Database related work is completed now you need to configure the " wp-config.php " File 

With

/** The name of the database for WordPress */
define('DB_NAME', 'YOUR_DB_NAME');

/** MySQL database username */
define('DB_USER', 'YOUR_DB_USER');

/** MySQL database password */
define('DB_PASSWORD', 'YOUR_DB_USER_PASSWORD');

/** MySQL hostname */
define('DB_HOST', 'YOURHOST'); //by default localhost

save the file and All done

Thanks

Cheers