|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
e1front Smarty n00b
Joined: 14 Jun 2003 Posts: 1
|
Posted: Sat Jun 14, 2003 10:30 am Post subject: newbie asking a stupid question |
|
|
I have my soft cart configured to display the credit card for customers for some wierd reasons
so we started to have complains about that
so we want to display the first 4 digits and the last 4 digits of the credit card number ...
the problem is , i only know "truncate", but this doesn't satisfy the job
here is how the process goes,
we fetch the credit card number corresponding to the user login name
we decrypt the credit card number in .php page
we have the code to display the credit card number in the .tpl template
so we need to display 1111222233334444
as 1111....4444
aslo should i decrypt the first 4 and the last 4 digits only, or there is no such a thing???
please remember i am a really newbie here,
so i need more clarification
thanks |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Sat Jun 14, 2003 12:54 pm Post subject: |
|
|
hi e1front:
My suggestion is to consider not sending the complete CC # to the template at all. Instead chop it up in PHP before you assign it to the template.
Either of the following which (should) do a 1234abcde5678 => 1234#####5678 type conversion-- but I didn't test them.
[php:1:d921103be0]<?php
$cc = substr($cc, 0, 4) . str_repeat('#', strlen($cc)- . substr(strrev($cc), 0, 4);
// or using a regular expression...
$cc = preg_replace('!\d{4,4}(.)*\d{4,4}!u', '#', $cc);
?>[/php:1:d921103be0] |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|