nackgr Posted February 13, 2012 Share Posted February 13, 2012 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> Quote Link to comment https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/ Share on other sites More sharing options...
Adam Posted February 13, 2012 Share Posted February 13, 2012 This doesn't really sound like a job for JavaScript. If you want the numbers hiding, you should do so at the server level. I'm not sure what template engine you're using, but where ever you assign 'anum' you should do it there. Quote Link to comment https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/#findComment-1317519 Share on other sites More sharing options...
nackgr Posted February 13, 2012 Author Share Posted February 13, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/#findComment-1317520 Share on other sites More sharing options...
Adam Posted February 13, 2012 Share Posted February 13, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/#findComment-1317527 Share on other sites More sharing options...
nackgr Posted February 13, 2012 Author Share Posted February 13, 2012 you are right Quote Link to comment https://forums.phpfreaks.com/topic/257011-how-to-hide-digits/#findComment-1317532 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.