PHP - Mask Credit Card Information In Text Box
I need to display Credit card number with only last 4 digits visible.The remaining numbers should display as **
eg: If the credit card number is 2222 1111 3333 4444 its should display as **** **** **** 4444 in a textbox Can anybody provide me a solution Similar TutorialsMy website needs to collect credit card information WITHOUT 3rd party!
I asked godaddy what i is i need for that and they told me if i get a merchandising account with my bank and call them to tell them what i want to do they will send me a script and i use that script on my site.
Does anyone have experience with this?
my server is PCI compliant
Hi, I want to know something on credit card processing. I do not have any problem here, but want to know how ca shopping website is processed! For example, a website is selling shoes online, where people will use either VISA or any credit card to buy, then the shoes will be delivered to the person's place. I want to know, how these credit cards are stored, I mean do these information are stored in the database, the website administrator will take the credit number etc...to get the money from the bank? I'm looking at creating a web interface for cusotmers to enter credit card information. What is the best approach for this? Keeping in mind security of data... Maybe this last point is more a question for web server administrators, but thought I'd ask anyway. I have two sites on two different servers server1: has the purchase page where it asks for credit card numbers etc. server2: has the CGI files to send payment data directly into the payment processor. I cannot put the CGI files on server1 due to security restrictions, etc. My question is: How can I securely transmit the credit card data from server1 to server2? Thanks! This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=315057.0 Hi there.... I am facing problem regarding credit card transaction ....an error i am keep on getting "Security header is not valid"....i searched for that but all are saying that its because of using "wrong credentials"...but i have gone through all my docs....i think i am using the right one......anyone there to help me out please....i really need it to get done.........thanxx..... Hey, i have made a silly little tester game just to see if i could, its he http://www.zephni.com/test/pairs its for some guy who is attending college and he was given the assignment to make a game of pairs using PHP to sort the cards and lay them down, and javascript to handle the actual game. Anyway at the moment, my game sorts out the cards as if they are values from 1 to 52, and picks randomly 18 cards from them. During the game, the cards have to be excatly the same, as in: if(card_picked1 == card_picked2){ win pair } that means that both cards would have to be the same number AND suit. But in pairs you have to pick the same number but obviously in a different suit. Any way I have been trying some diff code to pick 18 cards from the pack. It picks 9, and then doubles them up but +'s 13 to the card so it is the same number card. Here is the code Code: [Select] <?php $i = 1; $total_cards = 18; #Sorting out cards $card_sort = range(1,52); while($i <= ($total_cards/2)){ $pick_card = $card_sort[rand(1,52)]; if($pick_card !== null){ $cards[] = $pick_card; } unset($card_sort[$pick_card]); $i = $i+1; } foreach($cards as $card){ echo($card."<br/>"); } ?> I would of thought that when you unset the number from $card_sort that was picked it would'nt choose it again if($pick_card !== null) but it still chooses the same card twice sometimes. I know I really havent explained this well, but i did my best for 9am... I am new to PHP so I'm sorry if anything I ask isn't clear. I'm actually a writer, but my boss randomly decided I need to learn PHP so here I am My first project is to take information from a simple HTML form that asks for users to fill out three text boxes, select if they are user 1 or user 2, and upload a file. I then have to store the information in a text file and display that information in the browser directly below the HTML form. The information must be ordered alphabetically by the first letter of whatever is entered in the first text box. Each entry must be on its own line. For example: Person 1 enters: Sally Mae Johnson User 1 Flowers.jpg Person 2 comes along later and enters: George Michael Johnson User 2 books.jpg Right now it displays in the order entered like this: Sally Mae Johnson User 1 Flowers.jpg George Michael Johnson User 2 books.jpg I need it to display in alphabetical order by the first letter of the first name like this: George Michael Johnson user 2 books.jpg Sally Mae Johnson User 1 Flowers.jpg I'm so close, but I just can't figure out how to finish it up. If anyone can help they'd be a life saver! Here's what I wrote so far: <body> <?php $fone = @$_POST["one"]; $ftwo = @$_POST["two"]; $fthree = @$_POST["three"]; $fselect = @$_POST["select"]; if ($_FILES) { $name = $_FILES['upload']['name']; (move_uploaded_file($_FILES['upload']['tmp_name'], "uploads/$name")); } //write to the file $values = "$fone\t"; $values .= "$ftwo\t"; $values .= "$fthree\t"; $values .= "$fselect\t"; $values .= "<img src='uploads/$name'><br />\n"; //open and write to the file $fp = @fopen("store.txt", "a") or die("Couldn't open the file!"); $numBytes = @fwrite($fp, $values) or die ("Couldn't write values to file!"); @fclose($fp); ?> <form action="test_it2.php" enctype="multipart/form-data" method="post"> Box 1: <input type="text" name="one" size="15" /> Box 2: <input type="text" name="two" size="15" /> Box 3: <input type="text" name="three" size="15" /> Select One: <select name="select"><option value="empty">Please Select</option><option value="user1">User 1</option> <option value="user2">User 2</option> <p>Upload a File:</p> <p><input type="file" name="upload" /> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <input type="submit" name="submit" value="submit" /> <input type="hidden" name="submitted" value="submitted" /> </p> </form> <?php print "<P>Here are the users:<br />"; $file = "store.txt"; if (file_exists($file)) { $file1 = fopen("store.txt" , "r"); while (!feof($file1)) { $display = fgets($file1, filesize("store.txt")); echo $display . " "; } fclose($file1); } else { echo "<P>Error occured! Please try again!</p>"; } ?> </body> </html> Hello! I have a 2 questions: Q1: How do you store answers from a php file(see code below) into another file?(php preferably) I know it would probably be easier using a database, but I would like to know how to do it with a text/php file. Below you can see a piece of code for a page students would go on to fill in online exercices. They would first have to input their names. These names would have to be sent to a php file called "StudentAnswers.php". As well as their answers I also have another file that is called "QandA.php" which is called on with include in the piece of code below so the students can't see the answers before they submitted their answers. Q2: But how do I complete the if code(see question marks) so the answer only shows IF(as soon as) they clicked on the submit button? Code: [Select] <html> <body> <h2>Exercices</h2> <p> <form name="input" action="StudentAnswers.php" method="get"> Student name: <input type="text" name="user" /> </form> </p> <p> What is the gradient of T(x,y)=2x+3? <form name="input" action="StudentAnswers.php" method="get"> <input type="text" name="1b" /> <input type="submit" value="Input answer"/> </form> if ( ????????? ) { ???????"; } <?php include("QandA.php"); echo $Question["1b"];?> <p> </body> </html> B I'm looking to open a custom giftcard shop in which I'll be selling giftcards at 75%-95% of the face value. (I usually buy them off ebay cheap and resell them). I've already got the login system complete by using one I found online. What I'm looking to do now is make the shop section now where I can import a text document with the giftcard #, and Pin number to have them all show up in a list (but have only the first 6 numbers show up and the rest stared out with "***" until purchased, with the option to add each individual one to the cart (checkboxes beside each one). But I want them to be able to buy them with "credits". Credits being a site currency I'd like to be created. I want users to be able to buy these "credits" with the LibertyReserve API. These credits are to be attached to their login until used up. 1 credit = 1$ LR I notice Libertyreserve has a sample shop script: http://www.libertyreserve.com/en/home/downloads , but it doesnt exactly have the credit features and cart features I stated above, however I'm sure can be somewhat useful in coding what I need. Any help would be greatly appreciated, since I have no idea where to start. I'm sure this is basic to some, and well I'm looking to hire someone if they are confident they can complete this quick, otherwise any free feedback would help so much. Here is the site so far... http://www.eliteids.com/lrstore i want to make virtual money (credits, tokens) whatever you want to call it but make no mistake this is not for profit at this point but i like the concept of visitors having something to do with other members of site for example to kill bordom and create a reason to play games, compete in competetions, it will have to conversion to real money at this point but i wish to do this script using php and mysql and have very basic coding skills in these areas anyone please help me make this script... reply and let me know if you like this idea please help me as this is achievable as fb has it and more sites are moving toward these same ideas, even tho fb is real money it is more to do with fun at this point until we do this stage another stage canot proceed it. Hey guys, I am new to php and I have a project to do that includes creating a payroll system.What i am trying to get done is a clock in and clock out time card using php.This is what I have so far but when I run it, the date and time is incorrect can someone please help me Hello, I'm trying to use a rest-based card clearence service, but I don't know how to pass the information through the URL without using the form action attribute. I need to have a URL looking like this: index.php?p=checkout?service=cardAuth&msg_id=3864&num_md5=e2740266aab85558996a9a87fc561c0e&amount=24.99¤cy=GBP&api_key=739a720ade31ad2a14b30aa7b3a6b20e But at the moment, I have a URL looking like this: index.php?cardAuth=&title=Mr&fname=Alderton&sname=Arkie&ctype=mastercard&cnumber=5105105105105100&smonth=01&syear=07&fmonth=01&fyear=10&checkout=Check+Out There's a few more problems; - I can't get the card number to md5 - I don't know how to retreive a variable used in another file, which counts up the total amount due Here's my PHP: Code: [Select] <h2>Please enter your details</h2> <h3>All fields required</h3> <div id="checkout"> <?php if (isset($_GET['checkout'])){ $title = $_GET['title']; $fname = $_GET['fname']; $sname = $_GET['sname']; $ctype = $_GET['ctype']; $cnumber = md5($_GET['cnumber']); $syear = $_GET['smonth'] . $_GET['syear']; $fyear = $_GET['fmonth'] . $_GET['fyear']; $service = $_GET['cardAuth']; $amount = $_REQUEST[$total]; $msg = rand(1000,9999); $api = 'd41d8cd98f00b204e9800998ecf8427e'; } ?> <form method="get" action="index.php?p=checkout?<?php.'service='.$service.'msg_id='.$msg.'num_md5='.$cnumber.'amount='.$amount.'currency=GBP'.'api_key='.$api.?>"> <table> <tr> <td><input type="hidden" name="cardAuth" value="<?php if (!empty($service)) echo $service; ?>" /></td> </tr> <tr> <td> Title: </td> <td> <select name="title" value="<?php if (!empty($title)) echo $title; ?>" > <option></option> <option>Mr</option> <option>Sir</option> <option>Ms</option> <option>Miss</option> <option>Mrs</option> </select> </td> </tr> <tr> <td> First Name: </td> <td> <input type="text" name="fname" value="<?php if (!empty($fname)) echo $fname; ?>"/> </td> </tr> <tr> <td> Surname: </td> <td> <input type="text" name="sname" value="<?php if (!empty($sname)) echo $sname; ?>"/> </td> </tr> <tr> <td> </td> </tr> <tr> <td> Card Type: </td> <td> <select name="ctype" value="<?php if (!empty($ctype)) echo $ctype; ?>"> <option>mastercard</option> <option>visa</option> <option>amex</option> <option>solo</option> <option>maestro</option> <option>jcb</option> <option>diners</option> </select> </td> </tr> <tr> <td> Card Number: </td> <td> <input type="text" name="cnumber" value="<?php if (!empty($cnumber)) echo $cnumber; ?>"/> </td> </tr> <tr> <td> Valid From: </td> <td> <select name="smonth" value="<?php if (!empty($smonth)) echo $smonth; ?>"> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> </select> <select name="syear" value="<?php if (!empty($syear)) echo $syear; ?>"> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> </select> </td> </tr> <tr> <td> Expires End: </td> <td> <select name="fmonth" value="<?php if (!empty($fmonth)) echo $fmonth; ?>"> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> </select> <select name="fyear" value="<?php if (!empty($fyear)) echo $fyear; ?>"> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> </select> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="checkout" value="Check Out"/> </td> </tr> </table> </form> </div> Hello! I have sim card, how can we integrate it with server and use web interface to send sms and other requests, all handled via PHP?? Just an idea will be appreciated. thanks watsmyname Hello, I'm a beginner programmer, and for my first "php-script" im trying to deal myself two holecards. It's easy to get dealt the first card, but when the second card arrives I have to remove the first card from the array. How to do that? Or I could do like i have tried he if ($y != $x) { echo $y; }. Problem is when holecard number one = holecard number two it wont echo anything. So i need to say if holecard one = holecard two { do a new random }. But how do i do that? <?php function poker() { $cards = array("Ah", "Ac", "Ad", "As", "2h", "2c", "2d", "2s", "3h", "3c", "3d", "3s", "4h", "4c", "4d", "4s", "5h", "5c", "5d", "5s", "6h", "6c", "6d", "6s", "7h", "7c", "7d", "7s", "8h", "8c", "8d", "8s", "9h", "9c", "9d", "9s", "Th", "Tc", "Td", "Ts", "Jh", "Jc", "Jd", "Js", "Qh", "Qc", "Qd", "Qs", "Kh", "Kc", "Kd", "Ks"); $x = $cards[rand(0,51)]; echo "$x "; $y = $cards[rand(0,51)]; if ($y != $x) { echo $y; } } echo poker() . "<br>"; ?> Thanks! Not sure if this is in the right forum (if not can a mod move it please).... Im creating a site that is based on a subscription basis. Therefore i need to allow the user to input their card details for me to store to allow payments every month (and also for them to update when needed). How do you recommend storing card details in the database, im guessing its not secure just to store them as plain text? Opinions needed I need to display a number(the number is retrieved from the db) in the form input field such that only the last 4 digits is visbile, the remaining can be masked as * or X or whatever is applicable. I know the last 4 can be obtained as follows: Code: [Select] $number=substr($number,-4,4); But when i hit the submit button the form validates the input field and checks if the number is a valid number of a specific format. Therefore when I click on the submit button then I should still be able to unmask the masked numbers or do something similar that would help me validate the whole number. Code: [Select] <input type="text" name="no" value="<?php if(!empty($number)){ echo $number;} ?>"> Not so much of a programming problem as such but if I add the ability to recover accounts via IP address, is it possible to spoof an IP address? Is it a bad idea to automatically allow a user to reset a password if their IP (according to PHP) matches the IP that created the account? This is my school project "tv-info" that uses simple_html_dom.
My tv.php
// scrape a tag $html = file_get_html("http://www.ampparit.com/tv-opas?g=peruskanavat-1"); foreach($html->find($tag) as $e) $main = $e->plaintext . '<br />'; //plain $html = file_get_html("http://www.ampparit.com/tv-opas?g=peruskanavat-1"); echo $html->find('[table class="fullwidth"]', 1)->innertext.'</table>';So my problem is how I can remove some tags in this page? It shows too much things and what I want it is show only tv-table.. There is inside this this tv table like this: <table class="content-layout"> <tr> <td id="content" class="content"><div class="submenu-top-container"> <form action="haku" class="right" style="margin-top: 5px;"> <div class="input-wrapper"> <input type="text" name="q" placeholder="Kirjoita hakusana..." style="width: 165px;"><input type="hidden" name="t" value="tv"><button>Hae</button> </div> </form> <div class="submenu-top-item selected"> <a href="/tv-opas" class="submenu-top-item-link">Ohjelmaopas</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=suosikkikanavat" class="submenu-top-item-link">Suosikkikanavat</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=peruskanavat-1&ss=movies" class="submenu-top-item-link">Elokuvat</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=peruskanavat-1&ss=sports" class="submenu-top-item-link">Urheilu</a> </div> <div class="submenu-top-item "> <a href="/tv-opas?g=peruskanavat-1&ss=favorites" class="submenu-top-item-link">Suosikit</a> </div> </div>Thank you if someone can help me! And if someone ask me to use tvrage, I don't because I'm from Finland and there is no support for Finnish tv-series etc.. |