Jump to content

How to hide digits


nackgr

Recommended Posts

Hallo

 

We have  a table that saws calling numbers report

 

 

The <td>  <td nowrap >{anum}</td> saws the number that our clients number  has dial how can i make this td  everytime hide the last 4 digits

 

Thanks!!

 

<calls_list>
<table class="callsListTable" cellpadding="10">
<tr class="title">
<td width="40"></td>
<td width="20%">{word:date}</td>
<td width="20%">{word:country}</td>
<td width="20%">{word:to_number}</td>  
<td width="20%">{word:from_number}</td>
<td width="20%">{word:cost}</td>
<td width="20%">{word:time}</td>
<td width="20%">{word:price}</td>
</tr>
<call>
<tr class="line{class}">
<td><img src="/templates/g/images/{cdir}.gif"></td>
<td>{calldate}</td>
<td>{rdest}</td>
<td nowrap>{bnum}</td>
<td nowrap >{anum}</td>
<td>{mcost}</td>
<td>{billsec}</td>
<td>{ccost} {curr}</td>
</tr></call>
<tr>
<td colspan="5"></td>
<td colspan="3" align="right"><b>{word:total_calls_cost}: {total_calls_cost} Eur</b></td>
</tr>
</table></calls_list>

Link to comment
https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/
Share on other sites

the anum  is the called number  and we get it from a external xml gateway that hold all details

 

A friend gave me this

 

<script>

var a = '31sd232fsd12ddf143';

var b = a.substring(0, (a.length-4)) + '****';

alert(b);

</script>

 

but i am not so relative with js  :(

Link to comment
https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/#findComment-1317520
Share on other sites

Where do you substitute "{anum}" for the value in the server-side code? Even if it's a feed, you still need parse the template at some point. I'm guessing the last four digits are sensitive for some reason - otherwise why would you need to hide them? Using JavaScript would mean you're still sending the original, desensitised data to the client (so it would still be visible in the source). There might also be a delay in replacing the text, so the user sees the last four digits for a short amount of time. Also any user with JS disabled would always see the original data.

 

As I said, you need to use server-side code to properly sensitise data like this.

Link to comment
https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/#findComment-1317527
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.