This page isn’t working Chrome detected unusual code on this page and blocked it to protect your personal information. ERR_BLOCKED_BY_XSS_AUDITOR

This page isn't working
Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards).
ERR_BLOCKED_BY_XSS_AUDITOR




This page isn’t workingERR_BLOCKED_BY_XSS_AUDITOR

Mainly,

This error message is occurs when we are trying to post a content with HTML tags or Scripts Tags or Like When Google Chrome believes a “cross-site scripting” attack is happening. These attacks happen when a browser is tricked into rendering HTML or JavaScript that is not meant to be a part of the website being displayed.

Then Chrome Generates This ERROR ”
ERR_BLOCKED_BY_XSS_AUDITOR

For PHP and All Other PHP Frameworks: Add this below line before post

 header('X-XSS-Protection:0'); 

Print the Div Contents in Php or Javascript

The JavaScript is below..

<script type="text/javascript">
var base_url="<?php echo $this->request->webroot; ?>";

function printDivContents(divID="xshr_print_section") {

    //Get the HTML of div
    var divElements = document.getElementById(divID).innerHTML;
    
    Popup(divElements);
}


function Popup(data) {
    var mywindow = window.open('', 'new div', 'height=400,width=600');
    mywindow.document.write('<html><head><title></title>');
    mywindow.document.write('<link rel="stylesheet" href="'+base_url+'"css/print.css" type="text/css" />');
    mywindow.document.write('</head><body >');
    mywindow.document.write(data);
    mywindow.document.write('</body></html>');

    mywindow.print();

    return true;
}
</script>

The HTML file is like-

<div id="xshr_print_section">
<!-- here the printing Contents -->

-
-
-
</div> 

PHP – Foreach Pass-by-Reference ? Do it now!

Normally, when we are using the “Pass-By-Reference” in the foreach block we write code like below..

foreach ($array as &$row) {
// we Just Do Our stuff
}

We Must Have to “Unset” when we use “Pass-by-Reference”. Otherwise the array data may be altered. So, BEWARE.!

foreach ($array as &$row) {
// We Just Do Our stuff

// Now Unset after the Stuff
unset($row);
}

Don’t forget to “unset” the reference variable after the loop.

//---------------------------------
// Normally we do
//---------------------------------

$main_array = array('1','2','3','4');
$sub_array = array('11','22','33','44');


print_r($main_array);

print_r($sub_array);


/*
# Actual Array Data:
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
)
*/

$main_text = "";
foreach($main_array as &$row) {
    $main_text .= $row.',';

}

$sub_text = "";
foreach($sub_array as $row) {
    $sub_text .= $row.',';
}


print_r($main_array);

print_r($sub_array);



/*

# (main_array) Altered Data:

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 44
)

# (main_array) Expected Data:

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
)
*/

//-------------------------------
//	We Have to Use Like this
//-------------------------------

$main_text = "";
foreach($main_array as &$row) {
    $main_text .= $row.',';

    //Unset the pass-by-reference variable
    unset($row);
}

/*
// Now the Result will not altered

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
)
*/

This is because when the second loop executes, $row is still a pass-by-reference variable.
Thus, with each iteration the original reference is overwritten.

PayTM Payment Gateway Integration – After Payment Response Data

#PayTM Payment Gateway Integration – After Payment Response Data

 

RESPONSE ATTRIBUTESTYpeDescription
MIDString(20)This is a unique identifier provided to every merchant by Paytm
TXNIDString(64)This is a unique Paytm transaction ID that is issued by Paytm for each transaction
ORDERIDString(50)Unique reference ID for a transaction which is generated by merchant and sent in the request
CUST_IDString(64)Unique reference ID for every customer which is generated by merchant and sent in request
BANKTXNIDStringThe transaction ID sent by the bank. In case of Paytm proprietary instruments too, there is unique reference number generated by Paytm’s system. In case the transaction does not reach the bank, this will be NULL or empty string. Primary reason for this is user dropping out of the payment flow before the transaction reaches to bank to servers
TXNAMOUNTString(10)Amount paid by customer in INR
CURRENCYString(3)Currency in which the transaction has taken place. Currently only “INR” is the supported currency of transaction
STATUSString(20)This contains the transaction status and has only three values: TXN_SUCCESS, TXN_FAILURE and PENDING
RESPCODEString(10)Codes refer to a particular reason of payment failure. List in this PDF
RESPMSGString(500)Description message is linked with each respcode. List in this PDF
TXNDATEDateTimeDate and Time of transaction in the format “yyyy-MM-dd HH:mm:ss.S”Example: “2015-11- 02 11:40:46.0”
GATEWAYNAMEString(15)Gateway used by Paytm to process the transactions. By paymodes, the details are provided below
Credit, debit cards UPI – Gateway used to process the transaction. For example, if HDFC gateway has been used to process SBI credit card transactions, the value will be HDFC
Net banking – Netbanking transactions are not routed via gateway. Hence issuing bank name is passed in this field
Paytm Wallet – Wallet
BANKNAMEString(500)Name of issuing bank of the payment instrument used by customer. By paymodes, the details are provided below
Credit, debit cards, net banking – Name of the issuing bank. Example in case customer uses SBI’s credit card, the value will be “SBI”
Paytm Wallet – Wallet
Note that in case of UPI – This parameter will be not be present in the response
PAYMENTMODEString(15)The payment mode used by customer for transaction
Credit card – CC
Debit card – DC
Net banking – NB
UPI – UPI
Paytm wallet – PPI
CHECKSUMHASHString(108) Security parameter to avoid tampering. Verified using server side checksum utility provided by Paytm. Utilities to generate checksumhash is available here
BIN_NUMBERString(6)Starting 6 digit of Credit Card/Debit Card which used in transaction.
For other modes, this field not provided in response
CARD_LAST_NUMSString(4)Last 4 digit of Credit Card/Debit Card which used in transaction.
For other modes, this field not provided in response

 

Paytm Payment Gateways Response Data, After Payment.