Pages

Tuesday, 10 December 2013

How to integrate paypal by php

Paypal is the most used online payment gateway in the world. It is secured for both buyer and seller. So, for online transaction both buyers and sellers like to use it. But how PayPal gateway is integrated in web? A lot of tutorials are available in online. I will discuss here about the easiest way to integrate.

I will use PHP language for integrate it.

First Step: Create a Form

Keep the information of product items that you want to sell in a form. It is just a html form tag (<form>). Below is an example of a form:

<form action="https://www.paypal.com/cgi-bin/webscr" method="POST">

<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="nurulsnit@gmail.com">
<input type="hidden" name="item_name" id="item_name" value="My Product" />           
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount" value="10" />

<input type="submit" value="Buy Now"  />

</form>

Explanation of the above code:
Form action = https://www.paypal.com/cgi-bin/webscr. It is live paypal link. If you want to test the payment you can use sandbox paypal link. ( Sandbox is a test mode of paypal, in next post i will discuss about sandbox ).

Sandbox form action will be = https://www.sandbox.paypal.com/cgi-bin/webscr

<input type="hidden" name="cmd" value="_xclick" />, it is an essential variable for paypal transaction. This is a hidden type variable which name is cmd and value = _xclick.

business variable contains your paypal business account mail address. In this paypal account the payment will send. It is the seller paypal id.
item_name is the product name which is selling or purchasing.
currency_code is the currency name of transaction.
amount is the product price amount.
        

Monday, 25 November 2013

Date format change by php code

For software development we need different types of date format.

We can do it by a simple line of code. There is an example below:
$cdate = '2013-10-25';  // Y-m-d format
$rdate = date("d-m-Y",strtotime($cdate));  // d-m-Y format
echo $rdate;
I think it will help you.

Tuesday, 12 November 2013

Take difinite number of word from a string

The following function is for to take a definite number of words from an string:

function take_definite_number_word( $words = 10)
{
     $wordCount = count(explode("",$item->description));      // count by space
     if ($wordCount<$words)
    {
            $adjustedText = $item->description;
     }
     else
    {
          $adjustedText = implode(" ", array_slice(explode(" ",$item->description), 0, $words));
    }
}

Sunday, 29 September 2013

youtube video is not showing in Mozilla Firefox but google chorome and safary ok

It is a recent problem/bug with Mozilla Firefox browser.
We know, in your computer the browser is updating each time if you are net connected.
If you open your Mozilla Firefox browser and click on Help->About Firefox the it search the latest version of Firefox and update it.

In latest version of Mozilla Firefox it is now showing embeded  videos like youtube.
If you get this problem  that youtube video is not showing in Mozilla Firefox but in Google chrome and safari it is showing the videos then you will have to do the following tasks.

1. Clear the cache  from Tools->Options->Advanced->Network tab Ofline web content and user data. Click on Clear Now Button.

2. Now go to Tools -> Options -> Privacy .  Click on remove individual cookies link at the last line in History section.

If you load the video by iframe just add https:// ( dont use http:// ). ie. https://www.youtube.com

This will fix your bug.

Monday, 23 September 2013

Online Income Types

If you want to be expert in IT profession, then at first you will have to make your mind that anyhow i will be IT expert.

There are lots of non IT works in online too. But those are low price than IT work hour rates. So it is better to adopt IT techniques.

If you have a rich elance or odesk profile then it will be easy to get works.

There are lots of freelancing sites in online. but you will have to work from reliable sites.

Learn php

Now we will start learning php:

at first you will use the php start tag <?php

then write your codes, suppose:   echo "This is my firt line of code!";

then close the php tag by ?>

If you run it in server then we will get the following output:

 This is my firt line of code!

so the code is here:

<?php

  echo "This is my firt line of code!";

?>

Tuesday, 30 July 2013

how turn off magic quote in server

at first create a file named php.ini
write the following code in the php.ini file,
magic_quotes_gpc = Off
extension=pdo.so
extension=pdo_mysql.so

then upload it to root folder. i.e. in your site root folder.

Then create a .htaccess file in root folder

put the following code in top of the .htaccess file
<IfModule mod_suphp.c>
  suPHP_ConfigPath /home/myusername/public_html/yourJ3folder
  <Files php.ini>
    order allow,deny
    deny from all
  </Files>
</IfModule>

Change "myusername" and "yourJ3folder" to your respective folders.
The "/home/myusername/public_html/yourJ3folder" can be found via 
the Global Configuration

Friday, 24 May 2013

learn php coding



Computer Programming is very easy to learn”.  At first you will have to set this sentence in your mind. Then you will be able to be a best Programmer.
Everyone wants to know about Computer Programming but easily, they don’t want to spend time and brain. Even they don’t want to READ Articles. So, how they will learn?
I have planned to make easy for those lazy peoples. If they follow my guides and online instructions it will be easy for them to fulfill their dreams.
Any way, we will start now.
                    We are going to learn PHP and Mysql.
PHP is for coding and MYSQL is for database.

PHP:
          What is php? At first it was told Personal Home Page, but now it is told Hypertext Preprocessor.
You can run php in your computer by installing some software. I will guide you how to use WAMP.

Monday, 13 May 2013

Introduction with wordpress

Wordpress is the most used CMS for online applications. It is best blogger engine.

introduction with joomla cms

Joomla is a most used CMS(Content Management System) in php.
You can use joomla for any type of php application.

Wednesday, 8 May 2013

how redirect by .htaccess with a link of space %20

Redirect by .htaccess is easy for a server.
If you want to redirect a link then put the .htaccess file in root folder of the server.
Then put the following of code in .htaccess file.

Redirect 301 old_link.html  new_link.html

the above is normal rule. but if you have space in the old link (not _ ) then it makes problem.

then add the following code after RewriteEngine On

RewriteRule ^/?tag/(.*)\ (.*)$ /tag/$1-$2   [L,R=301]

then put the redirect condition suppose:

Redirect 301 '/codebooks/Malawi Geocoded Aid Codebook.pdf' http://aiddata.org/weceem_uploads/_ROOT/File/geocoding/UCDP_AidData_Codebook_Published.pdf

the Malawi Geocoded Aid Codebook.pdf is in single cote and this link has %20 or space

it was :  /Malawi%20Geocoded%20Aid%20Codebook.pdf 


i have become success by following above rule.





Friday, 3 May 2013

how on allow_url_fope in server

Some times you need to on allow_url_fopen in server. then you can try by the following two ways:

      1.   Create a .htaccess file and keep it to root folder ( sometimes it may need to place it one step back folder of the root) and paste this code there.
php_value allow_url_fopen On

     2.   Create a php.ini file (for update srver php5.ini) and keep it to root folder( sometimes it may need to place it one step back folder of the root) and paste the following code there

           allow_url_fopen = On;

I, personally get effet by using the above solutions.

Thursday, 18 April 2013

how write shorthand if else condition in php

If else condition is the first syntax that a programmer learn.
Generally we use like below condition:
if(condition)
{
   do some task
}
else
{
   do some task.
}

but you can use a short hand way, that will reduce your line of codes.

(condition) ? task1  :  task2

ie. if condition is ok the it will do task1 otherwise it will do task2

example:
<?php
$signal = '0';
$signal == '1' ? $message = 'I am right' : $message = 'I am wrong';
echo $message;
?>

Just copy and paste this code to a file and run in server. you will understand it.

Change  $signal variable, then it will do second task.









Monday, 15 April 2013

how off magic_quotes in php server

In php server you may need to On or Off different functions. Here has discussed how you can off

magic_quotes_gpc
magic_quotes_runtime
and magic_quotes_sybase

 you can off this functions by different ways. At first you can ask server authority to off it by changing this function On or Off.

or

you can write on .htaccess file

or

you can create a php.ini file and upload it to in your server root.

i have tried all of the above ways to Off magic_quotes_gpc , but could not.
Then i got a solution which is to create a php5.ini ( not php.ini ) and write the following codes to the file.

magic_quotes_gpc = Off;
magic_quotes_runtime = Off;
magic_quotes_sybase = Off;

Then i see it is Off now.

It is used for joomla 3 version articles edit for some servers.
 


Wednesday, 10 April 2013

আমরা বাংলাদেশিরা কিভাবে IT তে কারিয়ার গড়বো

আস-সালামু আলাইকুম,
                           আমি আজ আপনাদের ইনফর্মেশন টেকনোলজি তে কিভাবে কারিয়ার গড়বেন সেই বেপারে কিছু কথা বলতে চাই।
১। আই টি একটা সম্মানজনক পেশা । আপনাকে  এখানে একাগ্রতার সাথে কাজ করতে হবে

Friday, 5 April 2013

Learn php coding

If you want to make you a php developer you will have to follow the following instructions:

how you will learn coding

Today I will discuss about how you can learn coding.
Each person in  web development want to know about better coding system.
And in every profession, all wants to earn by other side works.
Programing can be a better option for side incomes.