Saturday, 16 March 2019

Form Variable of PHP

 php form Variables are used to get the data submitted through a html form. and in a html form there is only 2 method and they are get and post method.

so through html form we can send the data in 2 different method and they are get method and post method. and the example is given below,

Html Form With Post Method:

<html>
<body>
<form action="welcome_post.php" method="post">
Name: <input type="text" name="name">
Contact No: <input type="text" name="contact_no">
<input type="submit">
</form>
</body>
</html>

And Html Form With Get Method,

<html>
<body>
<form action="welcome_get.php" method="get">
Name: <input type="text" name="name">
Contact No: <input type="text" name="contact_no">
<input type="submit">
</form>
</body>
</html>

How to get php Form Variables

There is 3 different procedure to get the php form Variable and they are $_POST to get the post data send by a html form with post method, $_GET to get the data send by a html form by get method and in both method data can be get by $_REQUEST .
The $_POST, $_GET and $_REQUEST all are array type and super global Variable , that is it can be get inside or outside of scope ar in another word it can be say thet the ceriable can be fetched inside and outside of function in the page where the date is sent.
in all 3 cases the $_GET or $_POST or $_REQUEST return a array and according to the upper html example it will be array( 'name' => 'name input value', 'contact_no' => 'contact no input value')

Now theexample of how to get the php  Get Method php form Variable Example:

<?php
echo 'Name= ' . $_GET["name"] . '<br/>';
echo 'And Contact No = ' . $_GET["contact_no"];
?>

Post Method php form Variable Example:

<?php
echo 'Name= ' . $_POST["name"] . '<br/>';
echo 'And Contact No = ' . $_POST["contact_no"];
?>

Get and Post both canbe fetched by php form Variable Example:

<?php
echo 'Name= ' . $_REQUEST["name"] . '<br/>';
echo 'And Contact No = ' . $_REQUEST["contact_no"];
?>

Differents between GET and POST method,

Both GET and POST create an array. The array holds key/value, where keys are the names of the form input fields and values are the data given as input in the form fields by the user.
Both GET and POST are treated as $_GET and $_POST. These are superglobals, That is they are accesable inside or outside of scope or functions.
$_GET is an array of variables passed through the URL which is visible to all user.
$_POST is an array of variables passed through the HTTP POST method which is not visible by all user.
And also it can be said that through get method we can send less amount of data where through post method we can send greter ammount of data.
The amount of data sent through get method is dependable on browser and php both as php have its data limit and browser have its url lenght limit. but the data sent through post method is depend on the php only thet how much data limit is there.
Thanks for reading the PHP Form Variables post. Hope you are doing well.

Variables of PHP

php Veriables is one of the most intaresting portion of php tutorial, In case of  php Veriables the Veriables name is starts with $ like as $name,
there is no particular seperation for int or float or string in PHP Veriables there is only one syntex that the Veriables name will starts with $
Example:
<?php
$name = "Name Goes Here";
echo $name;
?>

How to Write a php Veriables.

to write a php Veriables developer have to maintain some roles, that the Veriables name must starts with a character after the sign of $
There should not a number or _ (underscore) at the begining but the _ or number can be used at the middle portion or at the end of a php Veriables.
In case of a php Veriables user can use uppercase or lower case both in any position of the Veriables name.
and user must not use a - (minas) or # or any special charanter except _ (underscore) while declaring php Veriables.
Example:
<?php
$name = "My Name";
$first_name = "My First Name";
$last_name_2 = "My Last Name";
$middleName = "My Middle Name";
?>

php Veriable inside or outside of Scope.

if a variable is declared outside of a function and call the theriable inside of the function it will give an error.
Example:
<?php
$name = "My Name";
function callName(){
echo $name; //will generate an error
}
callName();
echo $name; //will Print 'My name'
?>
similarly if a veriable is desclared inside of a function and user wanted to use the veriable outside of the function even after calling the function, it will generate an error.
Example:
<?php
function callName(){
$name = "My Name";
echo $name; //will Print 'My name'
}
callName();
echo $name; //will generate an error
?>

php Global Veriable.

To declare a global veriable in php the syntax is global and then the veriable name starting with $, user can declare the veriable and assign a value also befire make the veriable global and after making the veriable global the veriable can be used globaly. and any time the value changed of the veriable, after declaring the veriable as global it will assign the new value into the global veriable , maybe its inside or outside of the scope.
Example:
<?php
$a = 15;
$b = 20;
function myGlobalAddition() {
global $a, $b;
$b = $a + $b;
}
myGlobalAddition();
echo $b; //the outputs will be 35
?>
After declaring a veriable outside of scope, PHP also stores all global variables in an array, the name of the array is $GLOBALS['here will be the veriable name without $ sign']. The index holds the name of the variable. This array is also accessible from inside functions and can be used to update global variables.
Example:
<?php
$a = 15;
$b = 20;
function myGlobalAddition() {
$GLOBALS['b'] = $GLOBALS['a'] + $GLOBALS['b'];
}
myGlobalAddition();
echo $b; //the outputs will be 35
?>

Static Veriable in php 

Normaly when a function is exicuted all the veriable inside the function is gurbage cullected, but sometime we needed the loval veriable outside of the scope, at that time we can use static veriable. and to declare a veriable as static the syntex is static and then the veriable name.
Example:
<?php
function myStaticIncrement() {
static $a;
$a = 1;
echo $a;
$a++;
}
myStaticIncrement();
myStaticIncrement();
myStaticIncrement();
//the outputs will be
// 1
// 2
// 3
?>

How to declare an array in php ,

There is mainly two type of array in php, and they are signed and unsigned array, the signed array is the index of the array is given by user and it may be string or number but they must be unic for a particular array. and similarly an unsign array's index is automatically generated from 0 to the n-1 where n is the size of the array. and in both case the array is declared as veriable name equals array().
And there is multidimension array also and it is a array inside an array. the example is given below.
Example:
<?php
$unsigned_arr = array('red', 'blue', 'green'); // its a unsigned array
$signed_arr = array('clr1' => 'red', 'clr2' => 'blue', 'clr3' => 'green');//Its a signed array
$multy_dimensional_array = array(
'arr_ky1'=>array('red', 'blue', 'green'),
'arr_ky1'=>array('clr1'=>'red', 'clr2'=>'blue', 'clr3'=>'green')
); // The array is a multi dimensional array
?>
In that post we have learned about PHP veriables, and I hope its helped you to learn php.
Thanks for Reading.

PHP Syntex

In this part of the php tutorial we are going to learn about the basic syntex of php, As we have alrady told in our orevious post that php basic syntex starts with <?php or <? and in both case ends with ?> so if have to write any php script we have to write inside <?php ?>

now how to make a comment string in php,

to make a string commenting in php developer needs to give # (has) sign before the string or have to put // (double slash sign) before the string or to make comment any string inside a line or a part of string inside a line developer have to keep the commentable string inside /* (slash star) and */ (star slash) to make the portion commenting.
Example:
<?php
# the total lign will be commented
// in this case also the total lign will be commented
/* In this portion the string inside slash and star will be commented*/
echo 5 /* here will be the addition */ + 4;
?>

Now How to print a line in PHP.

There is mainly two process available in PHP to print and they are echo and print. In case echo a string needs to keep inside a double quote(“”). else if you keep the string in single quote(”) then the string will be printed as it is, that is, if you keep a variable inside the string it will print the veriable as its written instade of printing its value , The value will be printed if you keep the portion in a double quote(“”). and also the echo syntex is not case sensetive, that is you can write echo in upper or lower or mixture case and it will print the string.
Example:
<?php
$i = 10;
print("It will print the line inside the brasses and quote if it is not a veriable"); //It will print the line inside the brasses and quote if it is not a veriable
echo "The value of i = $i"; //The value of i = 10
echo 'The value of i = $i'; //The value of i = $i
EcHo "Print the value";//Print the value
ECHO "Print the value";//Print the value
echo "Print the value";//Print the value
?>

Concatenation in PHP

To concatinate in PHP we need to use . (dot sign) and it will join two string, an example is given below regarding that.
Example:
<?php
$i = 10;
echo 'The value of i = ' . $i . ' and it will print the value';
//The value of i = 10 and it will print the value
?>
I hope the post PHP basic syntex helped you and you have started to write php script by yourself.
Thanks for Reading.

How to Install PHP

to create a  PHP application first we need to install PHP in the local machine to practice more and more. so we are going to learn how to install PHP in Windows or Mac or Linux OS.


Install PHP in windows or mac


its very very easy process tiinstall WAMP in Windows or mac machine for that you have to go to the website of wampp and have to download that, and to download wampp for windows or mac follow the below described link:
https://www.wampserver.com/en/#download-wrapper
 
From the above link download the wamp for 64 bit machine or 32 bit machine. and then follow the instructions,
the instructions are also given on the wampp website also.
Installation instructions.
* Double click on the downloaded file and just follow the instructions. Everything is automatic. The WampServer package is delivered whith the latest releases of Apache, MySQL and PHP.
* Once WampServer is installed, you can manually add aditionals Apache, Php or MySql (only VC9, VC10 and VC11 compiled) versions. Explanations will be provided on the https://forum.wampserver.com/list.php?2.
* Each release of Apache, MySQL and PHP has its own settings and its own files (datas for MySQL).
How to use wampserver.
* The “www” directory will be automatically created (usually c:\wamp\www)
* Create a subdirectory in “www” and put your PHP files inside.
* Click on the “localhost” link in the WampSever menu or open your internet browser and go to the URL : https://localhost


Another simple process to install PHP in widows or mac,



There is another cery simple way to install php on windows or mac machine , by installing xampp, to install xampp you need to first go to the website of xampp, you can go to xampp website by clicking the below link also,
the link is: https://www.apachefriends.org/index.html
* after downloading doubble click on the downloaded installer file and just fllow the instruntions appear during the installation.
For both case you need to remember that skype should be exited else it will block the port 80, and in that setuation you have to install wampp or xampp and use from port 8080 or other.
Now we are going to see how to install PHP on linux machine.
We have alrady discussed about the both software xampp and wamp and both software have linux version , and if that support your linux version then its as easy as before. but if not then you need to install from the terminal.
here I am going to shoe how to install php on ubuntu machine.
to install php in a ubuntu linux machine flow the below instructions.
Step 1: Install Apache and Allow in Firewall

Open your terminal to install apache and input the below code one by one , here i am given the output also for the commend inserted on the terminal.

sudo apt-get update
 
sudo apt-get install apache2
sudo apache2ctl configtest
Output
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
sudo nano /etc/apache2/apache2.conf
ServerName server_domain_or_IP
sudo apache2ctl configtest
Output
Syntax OK
sudo systemctl restart apache2
sudo ufw app list
utput
Available applications:
Apache
Apache Full
Apache Secure
OpenSSH
sudo ufw app info "Apache Full"
Output
Profile: Apache Full
Title: Web Server (HTTP,HTTPS)
Description: Apache v2 is the next generation of the omnipresent Apache web
server.
Ports:
80,443/tcp
sudo ufw allow in "Apache Full"
https://your_server_IP_address
Now to findout server ip address:
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
sudo apt-get install curl
curl https://icanhazip.com
Step 2: Install MySQL
sudo apt-get install mysql-server
mysql_secure_installation
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No:
There are three levels of password validation policy:
LOW Length &gt;= 8
MEDIUM Length &gt;= 8, numeric, mixed case, and special characters
STRONG Length &gt;= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Using existing password for root.
Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
Step 3: Install PHP
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
 
sudo nano /etc/apache2/mods-enabled/dir.conf
sudo systemctl restart apache2
sudo systemctl status apache2
Sample Output

● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Wed 2016-04-13 14:28:43 EDT; 45s ago
Docs: man:systemd-sysv-generator(8)
Process: 13581 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 13605 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
Tasks: 6 (limit: 512)
CGroup: /system.slice/apache2.service
├─13623 /usr/sbin/apache2 -k start
├─13626 /usr/sbin/apache2 -k start
├─13627 /usr/sbin/apache2 -k start
├─13628 /usr/sbin/apache2 -k start
├─13629 /usr/sbin/apache2 -k start
└─13630 /usr/sbin/apache2 -k start
Apr 13 14:28:42 ubuntu-16-lamp systemd[1]: Stopped LSB: Apache2 web server.
Apr 13 14:28:42 ubuntu-16-lamp systemd[1]: Starting LSB: Apache2 web server...
Apr 13 14:28:42 ubuntu-16-lamp apache2[13605]: * Starting Apache httpd web server apache2
Apr 13 14:28:42 ubuntu-16-lamp apache2[13605]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerNam
Apr 13 14:28:43 ubuntu-16-lamp apache2[13605]: *
Apr 13 14:28:43 ubuntu-16-lamp systemd[1]: Started LSB: Apache2 web server.
Install PHP Modules
apt-cache search php- | less
 
libnet-libidn-perl - Perl bindings for GNU Libidn
php-all-dev - package depending on all supported PHP development packages
php-cgi - server-side, HTML-embedded scripting language (CGI binary) (default)
php-cli - command-line interpreter for the PHP scripting language (default)
php-common - Common files for PHP packages
php-curl - CURL module for PHP [default]
php-dev - Files for PHP module development (default)
php-gd - GD module for PHP [default]
php-gmp - GMP module for PHP [default]

:
Press q to quit
apt-cache show package_name
apt-cache show php-cli
Output

Description-en: command-line interpreter for the PHP scripting language (default)
This package provides the /usr/bin/php command interpreter, useful for
testing PHP scripts from a shell or performing general shell scripting tasks.
.
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
open source general-purpose scripting language that is especially suited
for web development and can be embedded into HTML.
.
This package is a dependency package, which depends on Debian's default
PHP version (currently 7.0).

sudo apt-get install php-cli
sudo apt-get install package1 package2 ...
Step 4: Test PHP Processing on your Web Server
sudo nano /var/www/html/info.php
it will open a editable page and type there
&lt;?php
phpinfo();
?&gt;
and then save
then go to your browser and type
https://your_server_IP_address/info.php
and you are rady to make code.
Hope the post how to install php on your local server helped you,

Thanks a lot for reading.

Overview of PHP

 PHP is a server side scripting language, and a powerful tool for making dynamic Web Sites.  PHP  started as a small open source project and letter people found it very usefull now its used in many large website like as favebook.com or youtube.com
 *  PHP  is a stands for PHP: Hypertext Preprocessor.
 *  PHP is a server side scripting language that is embedded in HTML.
 * It van be integrated with a number of popular databases like MySQL(mysql is included with wamp or xampp etc), or Microsoft SQL Server.
 *  PHP  supports a large number of protocols such as POP3, IMAP, and LDAP. PHP5 is supporting the object oriented programming.
 *  PHP Syntax is Like as C language.

Print Hellow world in PHP

to print a string in php its uses echo , and using echo we are going to display Hello, World! and the code is given below
<html>
    <head>
    <title>Hello World</title>
    </head>
    <body>
    <?php echo "Hello, World!"; ?>
    </body>
    </html>
    

The most popular PHP script writting styles

There is several style to write a php code like as start with <?php and end with ?> , also can be start with <? and end with ?> and there is another style to write a php code which is start with <script language = "php"> and end with </script> The sample is given below. in case of writting a php code user must use the page extension as .php

<?php PHP code goes here ?>
    Or
    <? PHP code goes here ?>
  Or
    <script language = "php"> PHP code goes here </script>
    

What Can PHP Do?

With PHP we are not limited to output HTML. You can output images, PDF files etc. we can also output any text, such as XHTML and XML. * PHP can generate dynamic page content * PHP can create, open, read, write, delete, and close files on the server * PHP can collect form data * PHP can send and receive cookies * PHP can add, delete, modify data in your database * PHP can be used to control user-access * PHP can encrypt data

Why PHP?

* PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.) * PHP is compatible with almost all servers used today (Apache, IIS, etc.) * PHP supports a wide range of databases * PHP is free. Download it from the official PHP resource: www.php.net * PHP is easy to learn and runs efficiently on the server side

PHP Tutorial for Biginners

Through the php tutorial we will cover all the basic syntax and procedure of php , also have covered the mandatory parts to make a php based website.

What is PHP?

The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build your base with PHP.

What does PHP do?

php runs in server side as it is a server side scription language, and it transform the php page to html code and send to clients machine which is ahown in clients browser.

 Tutorial overview.


Thanks for reading the PHP Tutorial.
  1. PHP Tutorials Overview
  2. overview of php
  3. PHP Installation 
  4. PHP Syntax
  5. PHP Variables
  6. PHP Form Variables
  7. PHP Session ans Coockies 
  8. PHP If Else Condition 
  9. PHP Switch Case
  10. PHP Arrays
  11. PHP While Loops
  12. PHP For Loops 
  13. PHP Operators
  14. PHP Functions
  15. PHP Include
  16. PHP Upload File
  17. PHP File
  18. PHP Mail
  19. PHP Database Operations

  1. and after the php tutorial you will start to make your own dynamic website.
  2. Please Write us if the php tutorial is helpfull to you.

Friday, 8 January 2016

EBS payment getway development using php

In this Post I will explain how to integrate EBS payment gateway in php and uses of ebs_payment_getway.php page, Rc43.php page and ebs_payment_response.php Pages.
First I will explain basic components of EBS Integration :
ebs_payment_getway.php page:
             Last page of Merchant website before connecting to EBS payment integration. Merchant should collect the Customer Information and post to EBS the specified parameters.

Rc43.php page:
            File used to decrypt the EBS response

ebs_payment_response.php Page:
            Page to which the Merchant receives the response from EBS on completion of sale process.
            The response parameters given back to the return URL are listed below. The response is provided using POST method to the URL defined under

ReturnURL
             parameter in the payment request.
Response is provided using POST method to the URL defined under ReturnURL parameter in the payment request. $response[‘ResponseCode’] == 0 means transaction successfully completed. Other than 0 value transactions failed.
For making LIVE, change the mode parameter value from TEST to LIVE in ebs_payment_getway.php file.

ebs_payment_getway.php Code

Needed varible for the page
             Please do not ommit any variable and maintain the secure hash veriable
<?php
$account_id='123456';//Sheller Ebs Account Id
$return_url="http://Localhost/ebs_payment_response.php?DR={DR}";//Returning url for detect success or unsuccess
$mode='TEST';// the mode of payment TEST/LIVE $order_no='Order_001234';//the purchase no of salling product $description='TESTING PRODUCT FOR PURCHASING ON EBS ';//description of salling product
$client_name='Client Name Here';//the name of byer
$client_address='City Center, Kolkata';//the address of byer $client_city='Kolkata';//the city of byer
$client_state='West Bengal';//the state of byer
$client_zipcode='700012';//the zipcode of byer
$client_country='India';//the country of byer
$client_phonenumber='+91 9999 999 999';//the contact no of byer $client_email='developerhiran@gmail.com';//the email address of byer $total_amount='100.00';//the bying total amount
$key='9876543210';//Sheller Ebs Key
$hash = $key."|".$account_id."|".$finalamount."|".$order_no."|".$return_url."|".$mode;//is for make a secure payment as user cannot able to change the description or any information
$secure_hash = md5($hash);//to encript the hash data
 ?>

Noe the html form
         Please do not change the name of the fields and acction paramiter of the form

<form method="post" action="https://secure.ebs.in/pg/ma/sale/pay" name="frmTransaction" id="frmTransaction">
         <input name="account_id" type="hidden" value="<?php echo $account_id; ?>" readonly/>
         <input name="return_url" type="hidden" size="60" value="<?php echo $return_url; ?>">
         <input name="mode" type="hidden" size="60" value="<?php echo $mode; ?>" readonly>
         <p>
                    <lable class="user-left">Order No:</lable>
                    <input name="reference_no" type="text" value="<?php echo $order_no; ?>" readonly>
         </p>
         <p>
                    <lable class="user-left"> Description:</lable>
                    <input name="description" type="text" value="<?php echo $description; ?>" readonly>
         </p>
         <p>
                     <lable class="user-left">Name:</lable>
                     <input name="name" type="text" maxlength="255" value="<?php echo $client_name; ?>" readonly>
         </p>
         <p>
                     <lable class="user-left">Address:</lable>
                     <input name="address" type="text" maxlength="255" value="<?php echo $client_address; ?>" readonly>
         </p>
         <p>
                     <lable class="user-left" > City:</lable>
                     <input name="city" type="hidden" maxlength="255" value="<?php echo $client_city; ?>" readonly>
         </p>
         <P>
                     <lable class="user-left" > State:</lable>
                     <input name="state" type="hidden" maxlength="255" value="<?php echo $client_state; ?>" readonly>
          </P>
          <p>
                     <lable class="user-left">Zipcode:</lable>
                     <input name="postal_code" type="text" maxlength="255" value="<?php echo $client_zipcode; ?>" readonly>
          </p>
          <p>
                     <lable class="user-left">Country:</lable>
                     <input name="country" type="text" maxlength="255" value="<?php echo $client_country; ?>" readonly>
          </p>
          <p>
                      <lable class="user-left">Phone No:</lable>
                      <input name="phone" type="text" maxlength="255" value="<?php echo $client_phonenumber; ?>" readonly>
          </p>
          <p>
                       <lable class="user-left">Email Id:</lable>
                       <input name="email" type="text" value="<?php echo $client_email; ?>" readonly>
          </p>
                        <input name="secure_hash" type="hidden" size="60" value="<?php echo $secure_hash; ?>" readonly>
          </p>
                        <lable class="user-left">Total Charges:</lable>
                        <input type="text" name="amount" id="amount" readonly value="<?php echo $total_amount; ?>" readonly>
          </p>
          <p style="text-align:center;">
                       <input type="submit" value="Place an Order" id="submit" name="submit">
         </p>
</form>

Noe the Full code of payment page
<?php
$account_id='123456';//Sheller Ebs Account Id
$return_url="http://Localhost/ebs_payment_response.php?DR={DR}";//Returning url for detect success or unsuccess
$mode='TEST';// the mode of payment TEST/LIVE $order_no='Order_001234';//the purchase no of salling product $description='TESTING PRODUCT FOR PURCHASING ON EBS ';//description of salling product
$client_name='Client Name Here';//the name of byer
$client_address='City Center, Kolkata';//the address of byer $client_city='Kolkata';//the city of byer
$client_state='West Bengal';//the state of byer
$client_zipcode='700012';//the zipcode of byer
$client_country='India';//the country of byer
$client_phonenumber='+91 9999 999 999';//the contact no of byer $client_email='developerhiran@gmail.com';//the email address of byer $total_amount='100.00';//the bying total amount
$key='9876543210';//Sheller Ebs Key
$hash = $key."|".$account_id."|".$finalamount."|".$order_no."|".$return_url."|".$mode;//is for make a secure payment as user cannot able to change the description or any information
$secure_hash = md5($hash);//to encript the hash data
 ?>
<!DOCTYPE html>
<html>
    <head>
          <title>Ebs Payment Getway</title>
    </head>
    <body>
         <div class="my-account-content whitespace">
                 
<form method="post" action="https://secure.ebs.in/pg/ma/sale/pay" name="frmTransaction" id="frmTransaction">
         <input name="account_id" type="hidden" value="<?php echo $account_id; ?>" readonly/>
         <input name="return_url" type="hidden" size="60" value="<?php echo $return_url; ?>">
         <input name="mode" type="hidden" size="60" value="<?php echo $mode; ?>" readonly>
         <p>
                    <lable class="user-left">Order No:</lable>
                    <input name="reference_no" type="text" value="<?php echo $order_no; ?>" readonly>
         </p>
         <p>
                    <lable class="user-left"> Description:</lable>
                    <input name="description" type="text" value="<?php echo $description; ?>" readonly>
         </p>
         <p>
                     <lable class="user-left">Name:</lable>
                     <input name="name" type="text" maxlength="255" value="<?php echo $client_name; ?>" readonly>
         </p>
         <p>
                     <lable class="user-left">Address:</lable>
                     <input name="address" type="text" maxlength="255" value="<?php echo $client_address; ?>" readonly>
         </p>
         <p>
                     <lable class="user-left" > City:</lable>
                     <input name="city" type="hidden" maxlength="255" value="<?php echo $client_city; ?>" readonly>
         </p>
         <P>
                     <lable class="user-left" > State:</lable>
                     <input name="state" type="hidden" maxlength="255" value="<?php echo $client_state; ?>" readonly>
          </P>
          <p>
                     <lable class="user-left">Zipcode:</lable>
                     <input name="postal_code" type="text" maxlength="255" value="<?php echo $client_zipcode; ?>" readonly>
          </p>
          <p>
                     <lable class="user-left">Country:</lable>
                     <input name="country" type="text" maxlength="255" value="<?php echo $client_country; ?>" readonly>
          </p>
          <p>
                      <lable class="user-left">Phone No:</lable>
                      <input name="phone" type="text" maxlength="255" value="<?php echo $client_phonenumber; ?>" readonly>
          </p>
          <p>
                       <lable class="user-left">Email Id:</lable>
                       <input name="email" type="text" value="<?php echo $client_email; ?>" readonly>
          </p>
                        <input name="secure_hash" type="hidden" size="60" value="<?php echo $secure_hash; ?>" readonly>
          </p>
                        <lable class="user-left">Total Charges:</lable>
                        <input type="text" name="amount" id="amount" readonly value="<?php echo $total_amount; ?>" readonly>
          </p>
          <p style="text-align:center;">
                       <input type="submit" value="Place an Order" id="submit" name="submit">
         </p>
</form>
         </div>
    </body>
</html>

Rc43.php Code
<?php
class Crypt_RC4 {
    var $s= array();
    var $i= 0;
    var $j= 0;
    var $_key;
    function Crypt_RC4($key = null) {
        if ($key != null) {
            $this->setKey($key);
        }
    }
    function setKey($key) {
        if (strlen($key) > 0)
            $this->_key = $key;
    }
    function key(&$key) {
        $len= strlen($key);
        for ($this->i = 0; $this->i < 256; $this->i++) {
            $this->s[$this->i] = $this->i;
        }
        $this->j = 0;
        for ($this->i = 0; $this->i < 256; $this->i++) {
            $this->j = ($this->j + $this->s[$this->i] + ord($key[$this->i % $len])) % 256;
            $t = $this->s[$this->i];
            $this->s[$this->i] = $this->s[$this->j];
            $this->s[$this->j] = $t;
        }
        $this->i = $this->j = 0;
    }
    function crypt(&$paramstr) {
        $this->key($this->_key);

        $len= strlen($paramstr);
        for ($c= 0; $c < $len; $c++) {
            $this->i = ($this->i + 1) % 256;
            $this->j = ($this->j + $this->s[$this->i]) % 256;
            $t = $this->s[$this->i];
            $this->s[$this->i] = $this->s[$this->j];
            $this->s[$this->j] = $t;
            $t = ($this->s[$this->i] + $this->s[$this->j]) % 256;
            $paramstr[$c] = chr(ord($paramstr[$c]) ^ $this->s[$t]);
        }
    }
    function decrypt(&$paramstr) {
        $this->crypt($paramstr);
    }
}
?>
ebs_payment_response.php Code
<?php
$response = array();
$secret_key = 'abcd123456';     // Your Secret Key
if(isset($_GET['DR'])) {
    require('Rc43.php');
     $DR = preg_replace("/\s/","+",$_GET['DR']);
     $rc4 = new Crypt_RC4($secret_key);
     $QueryString = base64_decode($DR);
  
     $rc4->decrypt($QueryString);
     $QueryString = explode('&',$QueryString);

     $response = array();
    foreach($QueryString as $param){
        $param = explode('=',$param);
        $response[$param[0]] = urldecode($param[1]);
     }
}

// payment sucess
if(($response['ResponseCode'] == 0))
{
    echo '<h2 style="text-align: center;">Thanks, Payment Success<h2><br/>';
    foreach( $response as $key => $value)
    {
        echo $key;
        echo ' => ';
        echo $value;
        echo '<br/>';
    }
}

// if payment failed
if(($response['ResponseCode'] != 0))
{
      echo '<h2 style="text-align: center;">Your Paument Fail <br/>Please Try again</h2>';
    foreach( $response as $key => $value)
    {
       echo $key;
       echo ' => ';
       echo $value;
       echo '<br/>';
    }
}
?>
EBS Testing Credentials
              EBS recommends you to make your Integration on Test Environment before going Live in the Production environment. EBS Test environment works in similar way to the Production Environment, except that you can test only Credit Card payments using the Test card details provided. To test the payments in Test mode, send the mode as TEST in payment request.

Name on card = ebs
Card Number= 4111 1111 1111 1111
Card Expiry Date= 07 (Jul) 2016
CVV = 123

Thanks A lot