473,320 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Authentication

155 100+
hi all ,im runing a site and i need to charge users!!

i have a form for entering data ,and all is working well!!

i got one program that calling my site and read a file that is return from a form of entering credit card details ,then the program is calling this file in my site and checking if there is problem with the card or its ok!!


what i need is the code to read the string for good and bad!

this is the starting code i found:
Expand|Select|Wrap|Line Numbers
  1. $myFile = "pull/INT_IN";
  2. $fh = fopen($myFile, 'r');
  3. $theData = fread($fh, 4);
  4. fclose($fh);

i want to have here the code like that:

if the string = 1111 ,the card is ok
if the string = 0000 ,the card is bad

sorry for my bad english :)

thanx
Nov 12 '08 #1
6 1165
pbmods
5,821 Expert 4TB
Heya, canabatz.

Do you need to validate credit card numbers? If so, you'll want to run them through the Luhn algorithm (http://www.google.com/search?q=php+luhn).
Nov 12 '08 #2
canabatz
155 100+
I dont need to validate , i got program connected direct to the credit card company ,and they checking the cards!!

i just want to read a file to say if there is 1111 in it or 0000 ,thats it! :)

thanx
Nov 13 '08 #3
Markus
6,050 Expert 4TB
Are you storing the values 1111 and 0000 in a text file? If so, read how to read a text file.
Nov 13 '08 #4
canabatz
155 100+
i know how to read test file ,what i need is

if {taxt file string is 1111}

do something

else if {taxt file string is 0000}

do something

i dont know how to tell the code that look for 1111 or 0000

thanx
Nov 13 '08 #5
I think it's quite simple, If only I am not wrong.
After you had read the 4 digit number in to the variable $theData just check it.

Expand|Select|Wrap|Line Numbers
  1. if ($theData == '1111') 
  2. {
  3.     echo 'The Card is ok';
  4. }
  5. elseif  ($theData == '0000') 
  6. {
  7.     echo 'The Card is not ok';
  8. }
Nov 13 '08 #6
canabatz
155 100+
i remember trying that before!!! ,and maybe there was something else wrong :)))


thanx allot man ,it's working like it need to!!

:)
Nov 13 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
9
by: Tom B | last post by:
In my web.config file I've specified Windows for the authentication, in IIS I've set it to Integrated Authentication. But my SQL connection is still showing Anonymous. Is there somewhere else I...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
4
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok....
0
by: Albertas | last post by:
What I'm doing wrong that I can't make my authentication to work. Here is the situation: I'm hosting a Web Service from a Windows forms application, using .NET Framework 3.0 WCF. And I want to...
18
by: troywalker | last post by:
I am new to LDAP and Directory Services, and I have a project that requires me to authenticate users against a Sun Java System Directory Server in order to access the application. I have found...
2
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.