openfire database connection problem in setup

When you setup the openfire on your server and if you face the database connection problem on your server than in many case the problem with the hostname. you need to use the hostname as “localhost” in case of database connection with your own server database.

Use hostname as domain or ip in case of  remote database connection. otherwise you need to use localhost  as hostname. so this issue will fix for sure.

 

Read More

download

Codeigniter common select query

 

This is the codeigniter function for common select query that you need to place in model. and call it from controller. suppose your model name is say “basic_model” than you need to call this function in controller like..

 

Parameter understanding :

$select           : string of database table column in comma separated or * for all column
$from             : string of database table name
$where          : An associative array in which array key should be table column and array value would be table column value
$group          : an array of database column e.g array(“user_id”) so it gives output as group by user_id
$order           : string of database column with ASC or DESC parameter e.g ‘user_id DESC’
$having        : string of database column with condition say sum(‘coin’) > 0
$limit            : an array of limit string e.g array(“10,0″) so this gives output as limit 0,10
$result_way : string for output way
$echo           : 0 or 1 . if you want the query string from codeigniter than set this value as 1

By changing the query guide functionality you can use this function for other framework or in cms.

Read More

Inapp purchase receipt validation in ios

There is a below function for validating the receipt for in-app purchase in ios. it return 1 or 0 for the receipt is an valid or an invalid.

The function contains two parameter in which the first parameter “$purchase” is a receipt that you get from apple server when a user has make the in-app purchase from device.

Read More

How to install laravel in windows

Laravel framework is an opensourc mvc framework. here we have step by step guidline to install the laravel framework on windows system.

First of all you need to install composer and for that we have two ways

first is composer set up install in your php file exits directory.:

Download composer set up: Compose set_up .exe

Note: for installation of composer setup you need to enable php_openssl.dll in php.ini. make sure you will change all php.ini files of your server.

Second is using CMD or manual installation in this way you need to change directory to your php file directory in your CMD.

then run this command line(for use of composer):

Create a new composer.bat file alongside composer.phar:

now, we can install laravel framework, in your cmd write this command line for create a new project

Download laravel master laravel-master.zip

After installation we can do some Configuration

Configuration :      open your index.php file in public directory and change

 

to

to

And open bootstrap/paths.php and change

to

 

now, you can start work with laravel frame work

Read More

send push notification from server to ios device using php

For sending the push notification from server to ios device using php than you can use below code function.
Requirement : you need to xyz.pem file that can be generate from your apple account. this certificate is in two type one id development and other is distribute certificate.

Now if you want to send the push notification to multiple devices than replace the try—catch code with below code snippet.

Read More

send push notification from server to android device using php

For sending the push notification from server to android device using php than you can use below code function.
ANDROID_APIKEY : this is api key of google project. you can find this key from google api console as server key.you must use here server key not android key.

You can set your custom parameter also as per your app requirement.

By providing multiple device token you can send push notification parallely to all devices.

Read More

How to get information of your ip : domain to lookup

For getting the information from the ip of server or our local system, There is a api for that in which the api proider gives the information related to ip.

For Example : if you need to the location information of client or end user ip than use below code.

Also if you want the DNS information of the ip than you need to use below api.

So you will get the below output :

Read More

Disallowed Key Characters In Codeigniter

This may occur because of cookie problem for your browser so for removing this error you need to test this url in separate browse or clear the cookie for your browser.i if you use google chrome than press ctrl + shift + n so that take you on new google chrome instance at where you can see that your link may work.

The cookie is __utmt. A Google Analytic cookie. The ~Number part probably means it’s a copy/duplicate. Think of it like the word.doc~1 files that are stored on your computer when working in a Word doc.

So first, check your Analytic code on the website, is the a duplicate somewhere? My problem was solved by altering this duplicated line:

Weird thing is that the file always had this duplicated line of code, for as far as my GIT goes back. It might be a change in the way analytics code handles cookies…

Oh, and the “Disallowed Key Characters” part. That’s normally a good thing, protecting your CI app against evil.

Its in the system\core\Input.php file.

Read More

custom post type in wordpress

Custom post types are new post types you can create. A custom post type can be added to WordPress via the function like register_post_type() . This function allows you to define a new post type by its labels, supported features, availability and other specifics.

Please make sure that you must call register_post_type() before the admin_menu and after the after_setup_theme action hooks. A good hook to use is the init hook.

Here’s a code sample for adding a custom post type:

Here we have created the custom post type as “cpt_team”. In which you can set your labels and accessibility.
Now we will add addition field by using add_meta_boxes.

So up to now we have created the UI for custom post type with additional field. now for storing the data of custom field like facebook link in our example in database for particular post than we need to put following code.

Now you can see in your WordPress admin panel that there there is “Our team” menu in left sidebar and after click on that you can add member and save the data related to member with custom field like Facebook link and you can also list the member data.

Read More

how to add wordpress page in admin without menu

For creating the wordpress admin page that you not need to add this in admin panel menu than follow the below step.

Key point : create sub menu with blank parent.

1) create the action for admin panel.

2) call the function add_submenu_page in which the first parameter is parent page. in that perticular case set it as blank means you need to set parent page as blank.

The other parameter of the wordpress function “add_submenu_page” set as per your requrnment.

Read More