I am performing some validation with js and php but i came randomly to firebug inspect console and all the variables come up in the console as shown in the screenshot. I thought if i return a variable from PHP with Json Encode
that will be hidden but it is visible in the console.
Is there a way to hide those values from showing to the user in the console? The main logic of the validation is in Javascript with conditions like so below then i compare the values in JS if they are equal to the string in PHP.
$row1 = "10010010";$row2 = "01001001";$row3 = "00100100";$row4 = "10010010";
$row5 = "01001001";$row6 = "00100100";$row7 = "10010010";$row8 = "01001001";
echo json_encode([
'row1' => $row1,
'row2' => $row2,
'row3' => $row3,
'row4' => $row4,
'row5' => $row5,
'row6' => $row6,
'row7' => $row7,
'row8' => $row8]
);
In JS:
//logic of validation in JS
if ( jsVariable === data.row1) //...
else //...
if (jsVariable2 === data.row2) //...
else //...
There are some very important things to learn here:
You can pass encrypted or hashed data to the browser in order for it to be passed back, or you can pass an opaque token that allows you to look up a particular piece of data on the server when it's passed back (this is generally referred to as a "session").
Note that if you decrypt the data in the browser, the user can intercept the decrypted copy. In short, never trust the browser .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.