Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

displaying CC #


Graveyard666

Recommended Posts

Posted

Hi,

 

i am re-designing my site and right now I'm working on the account_history_info.php page and I made a spot to show the user how they paid for the item ie credit card, paypal. But I don't know how I can get it to display only the last 4 digits of the credit card # and have XXXXXX for the remainder of the number

 

I searched the forum but didn't find an answer :(

 

jeff

Posted

does your database save only the last 4 digits?

 

can't you just call that table and output via php and manually type XXXXXX like

 

Credit Card: XXXXXX<?php echo $cc_field; ?>

Posted
thanks eww, i'll check into it

 

try this:

 

str_repeat('X', (strlen($cc_field) - 4)) . substr($cc_field, -4)

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted

Monika, where??

 

here is my code for pulling the CC number (in account_history_info.php):

 

			  <tr>
			<td class="main"><?php echo $order->info['cc_number']; ?></td>
		  </tr>

Posted
Monika, where??

 

here is my code for pulling the CC number (in account_history_info.php):

 

			  <tr>
			<td class="main"><?php echo $order->info['cc_number']; ?></td>
		  </tr>

 

 

please try this:

 

 

			  <tr>
			<td class="main"><?php echo  str_repeat('X', (strlen($order->info['cc_number']) - 4)) . substr($order->info['cc_number'], -4); ?></td>
		  </tr>

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Posted
please try this:

			  <tr>
			<td class="main"><?php echo  str_repeat('X', (strlen($order->info['cc_number']) - 4)) . substr($order->info['cc_number'], -4); ?></td>
		  </tr>

 

 

perfect Monika!!

 

thanks much!

Archived

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

×
×
  • Create New...